From 4cebfd634995e44f434e091994f2764a6446c989 Mon Sep 17 00:00:00 2001 From: Andy Lanoix Date: Tue, 22 May 2001 01:10:19 +0000 Subject: [PATCH] *giowin32.c: G_IO_WIN32_WINDOWS_MESSAGES channels not handled correctly in g_io_win32_check() --- giowin32.c | 9 ++++++++- glib/giowin32.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/giowin32.c b/giowin32.c index c542897..ae16dd3 100644 --- a/giowin32.c +++ b/giowin32.c @@ -511,6 +511,7 @@ g_io_win32_prepare (GSource *source, static gboolean g_io_win32_check (GSource *source) { + MSG msg; GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; @@ -521,7 +522,13 @@ g_io_win32_check (GSource *source) watch->pollfd.events, watch->pollfd.revents, channel->revents); if (channel->type != G_IO_WIN32_WINDOWS_MESSAGES) - watch->pollfd.revents = (watch->pollfd.events & channel->revents); + { + watch->pollfd.revents = (watch->pollfd.events & channel->revents); + } + else + { + return (PeekMessage (&msg, channel->hwnd, 0, 0, PM_NOREMOVE)); + } if (channel->type == G_IO_WIN32_SOCKET) { diff --git a/glib/giowin32.c b/glib/giowin32.c index c542897..ae16dd3 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -511,6 +511,7 @@ g_io_win32_prepare (GSource *source, static gboolean g_io_win32_check (GSource *source) { + MSG msg; GIOWin32Watch *watch = (GIOWin32Watch *)source; GIOWin32Channel *channel = (GIOWin32Channel *)watch->channel; @@ -521,7 +522,13 @@ g_io_win32_check (GSource *source) watch->pollfd.events, watch->pollfd.revents, channel->revents); if (channel->type != G_IO_WIN32_WINDOWS_MESSAGES) - watch->pollfd.revents = (watch->pollfd.events & channel->revents); + { + watch->pollfd.revents = (watch->pollfd.events & channel->revents); + } + else + { + return (PeekMessage (&msg, channel->hwnd, 0, 0, PM_NOREMOVE)); + } if (channel->type == G_IO_WIN32_SOCKET) { -- 2.7.4