gtk+ r20881 - in trunk: . gdk/win32



Author: bratsche
Date: Mon Jul 21 12:46:41 2008
New Revision: 20881
URL: http://svn.gnome.org/viewvc/gtk+?rev=20881&view=rev

Log:
2008-07-21  Cody Russell  <bratsche gnome org>

        Bug 153567 â Repaint glitches in widgets

        * gdk/win32/gdkevents-win32.c: Set a sync timer when
        we receive WM_SYNCPAINT, and RedrawWindow() once
        the timer expires.



Modified:
   trunk/ChangeLog
   trunk/gdk/win32/gdkevents-win32.c

Modified: trunk/gdk/win32/gdkevents-win32.c
==============================================================================
--- trunk/gdk/win32/gdkevents-win32.c	(original)
+++ trunk/gdk/win32/gdkevents-win32.c	Mon Jul 21 12:46:41 2008
@@ -139,6 +139,7 @@
 
 static gboolean in_ime_composition = FALSE;
 static UINT     modal_timer;
+static UINT     sync_timer = 0;
 
 static int debug_indent = 0;
 
@@ -2031,14 +2032,31 @@
 
 static VOID CALLBACK
 modal_timer_proc (HWND     hwnd,
-		   UINT     msg,
-		   UINT     id,
-		   DWORD    time)
+		  UINT     msg,
+		  UINT     id,
+		  DWORD    time)
 {
   if (_sizemove_in_progress)
     handle_stuff_while_moving_or_resizing ();
 }
 
+static VOID CALLBACK
+sync_timer_proc (HWND hwnd,
+		 UINT msg,
+		 UINT id,
+		 DWORD time)
+{
+  MSG message;
+  if (PeekMessageW (&message, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE))
+    {
+      return;
+    }
+
+  RedrawWindow (hwnd, NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+
+  KillTimer (hwnd, sync_timer);
+}
+
 static void
 handle_display_change (void)
 {
@@ -2824,6 +2842,13 @@
       *ret_valp = 1;
       break;
 
+    case WM_SYNCPAINT:
+
+      sync_timer = SetTimer (GDK_WINDOW_HWND (window),
+			     1,
+			     200, sync_timer_proc);
+      break;
+
     case WM_PAINT:
       handle_wm_paint (msg, window, FALSE, NULL);
       break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]