summaryrefslogtreecommitdiff
path: root/hw/xwin
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2009-05-18 18:14:41 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2009-06-29 17:54:40 +0100
commit638ca9a7a2363757dc5b5d456e10d34f6f158885 (patch)
tree4ceda4c3181c60ad24df4365d3ee8b32b688b917 /hw/xwin
parentb718b2e0880cf2b969675da98d5ef8a4a01ca5d6 (diff)
Cygwin/X: Avoid a visual glitch on window move in rootless modes
Handle and ignore WM_ERASEBKGND since we repaint the entire invalidated region anyhow (this avoids a white flickering on window resize) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'hw/xwin')
-rw-r--r--hw/xwin/winmultiwindowwndproc.c8
-rwxr-xr-xhw/xwin/winwin32rootlesswndproc.c11
2 files changed, 19 insertions, 0 deletions
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index bd9edcb4d..313822972 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -453,6 +453,14 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
HandleCustomWM_INITMENU ((unsigned long)hwnd, wParam);
break;
+ case WM_ERASEBKGND:
+ /*
+ * Pretend that we did erase the background but we don't care,
+ * since we repaint the entire region anyhow
+ * This avoids some flickering when resizing.
+ */
+ return TRUE;
+
case WM_PAINT:
/* Only paint if our window handle is valid */
if (hwndScreen == NULL)
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index e624ded36..4d7afee42 100755
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -783,6 +783,17 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
SendMessage (hwndScreen, message, wParam, lParam);
return 0;
+ case WM_ERASEBKGND:
+#if CYGDEBUG
+ winDebug ("winMWExtWMWindowProc - WM_ERASEBKGND\n");
+#endif
+ /*
+ * Pretend that we did erase the background but we don't care,
+ * since we repaint the entire region anyhow
+ * This avoids some flickering when resizing.
+ */
+ return TRUE;
+
case WM_PAINT:
/* BeginPaint gives us an hdc that clips to the invalidated region */