--- gtk+-2.20.0_orig/gdk/win32/gdkevents-win32.c	2010-03-22 13:44:10 +0100
+++ gtk+-2.20.0/gdk/win32/gdkevents-win32.c	2010-08-18 12:55:22 +0200
@@ -396,10 +396,9 @@ _gdk_events_init (void)
 gboolean
 gdk_events_pending (void)
 {
-  MSG msg;
   return (_gdk_event_queue_find_first (_gdk_display) ||
 	  (modal_win32_dialog == NULL &&
-	   PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE)));
+	   GetQueueStatus (QS_ALLINPUT) != 0));
 }
 
 GdkEvent*
@@ -3320,7 +3319,6 @@ static gboolean
 gdk_event_prepare (GSource *source,
 		   gint    *timeout)
 {
-  MSG msg;
   gboolean retval;
 
   GDK_THREADS_ENTER ();
@@ -3329,7 +3327,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 ();
 
@@ -3339,7 +3337,6 @@ gdk_event_prepare (GSource *source,
 static gboolean
 gdk_event_check (GSource *source)
 {
-  MSG msg;
   gboolean retval;
   
   GDK_THREADS_ENTER ();
@@ -3348,7 +3345,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
     {
