diff options
author | Cody Russell <bratsche@gnome.org> | 2008-07-21 12:46:41 +0000 |
---|---|---|
committer | Cody Russell <bratsche@src.gnome.org> | 2008-07-21 12:46:41 +0000 |
commit | c8fef535b20ad75f82739f68fce2216c1d62f6ab (patch) | |
tree | fb6fa904fe1b90e90a6b75f4ae00f4e31c026617 | |
parent | b06c30bb51ab8712efc89290bfe217d151fe9821 (diff) | |
download | gdk-pixbuf-c8fef535b20ad75f82739f68fce2216c1d62f6ab.tar.gz |
Bug 153567 – Repaint glitches in widgets
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.
svn path=/trunk/; revision=20881
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gdk/win32/gdkevents-win32.c | 31 |
2 files changed, 36 insertions, 3 deletions
@@ -1,3 +1,11 @@ +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. + 2008-07-21 Michael Natterer <mitch@imendio.com> * gtk/gtktoolbar.c (gtk_toolbar_class_init): use the simpler diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 6633f5920..6e3565469 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -139,6 +139,7 @@ static HKL latin_locale = NULL; static gboolean in_ime_composition = FALSE; static UINT modal_timer; +static UINT sync_timer = 0; static int debug_indent = 0; @@ -2031,14 +2032,31 @@ handle_stuff_while_moving_or_resizing (void) 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 @@ gdk_event_translate (MSG *msg, *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; |