summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorDieter Verfaillie <dieterv@optionexplicit.be>2011-10-21 11:38:31 +0200
committerAlexander Larsson <alexl@redhat.com>2011-11-10 17:40:55 +0100
commit1df95b4c0aac1194e0b84ab31fb3bafdadd7aaf8 (patch)
tree3a965008c16a2adc397ce6c296462d1b47a71b93 /gdk
parentd66ad8c39dc37b5c7b014de5c3b8ae96aae87c49 (diff)
downloadgtk+-1df95b4c0aac1194e0b84ab31fb3bafdadd7aaf8.tar.gz
win32: Call GetQueueStatus instead of PeekMessage PM_NOREMOVE
Calling PeekMessage can cause reentrant calls into the window procedure for sent (as opposed to posted) messages, so its not safe to call when we're not expecting reentrancy. Instead we call GetQueueStatus when we're just looking for availible messages. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=552041
Diffstat (limited to 'gdk')
-rw-r--r--gdk/win32/gdkevents-win32.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 5ea42453da..f62727d269 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -395,10 +395,9 @@ _gdk_events_init (void)
gboolean
_gdk_win32_display_has_pending (GdkDisplay *display)
{
- MSG msg;
return (_gdk_event_queue_find_first (display) ||
(modal_win32_dialog == NULL &&
- PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
+ GetQueueStatus (QS_ALLINPUT) != 0));
}
#if 0 /* Unused, but might be useful to re-introduce in some debugging output? */
@@ -3367,7 +3366,6 @@ static gboolean
gdk_event_prepare (GSource *source,
gint *timeout)
{
- MSG msg;
gboolean retval;
GDK_THREADS_ENTER ();
@@ -3376,7 +3374,7 @@ gdk_event_prepare (GSource *source,
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
(modal_win32_dialog == NULL &&
- PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
+ GetQueueStatus (QS_ALLINPUT) != 0));
GDK_THREADS_LEAVE ();
@@ -3386,7 +3384,6 @@ gdk_event_prepare (GSource *source,
static gboolean
gdk_event_check (GSource *source)
{
- MSG msg;
gboolean retval;
GDK_THREADS_ENTER ();
@@ -3395,7 +3392,7 @@ gdk_event_check (GSource *source)
{
retval = (_gdk_event_queue_find_first (_gdk_display) != NULL ||
(modal_win32_dialog == NULL &&
- PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
+ GetQueueStatus (QS_ALLINPUT) != 0));
}
else
{