A window size/move fix

Duane Clark dclark at akamail.com
Mon Feb 10 18:35:29 CST 2003

This patch fixes bugs 1265 and 1266. It is a separate bug from that 
addressed by the "Window resizing" patch from a few days ago.

A fair amount of detail about the problem can be found on the bug:

It basically comes down to this. The app calls MoveWindow immediately 
followed by a SetWindowPos that only resizes the window. This causes two 
X ConfigureNotify events to occur. The first ConfigureNotify notices 
that the current window size is not the same as the size in the event 
structure, and resizes the window back to the where it was! The second 
ConfigureNotify notices that new current size is not the size in the 
event structure, and resizes the window again to the correct size. But 
in the process of doing this, corruption of the contents can occur. Not 
to mention all the extra code executed.

The fix is simply, if we are about to resize or move the window, first 
check for and handle any pending ConfigureNotify events.

	Before changing window size/pos, handle pending ConfigureNotify events.

-------------- next part --------------
Index: dlls/x11drv/winpos.c
RCS file: /home/wine/wine/dlls/x11drv/winpos.c,v
retrieving revision 1.63
diff -u -r1.63 winpos.c
--- dlls/x11drv/winpos.c	8 Jan 2003 21:09:26 -0000	1.63
+++ dlls/x11drv/winpos.c	10 Feb 2003 22:33:20 -0000
@@ -887,6 +887,9 @@
     UINT wvrFlags = 0;
     BOOL bChangePos;
+    /* This is needed to flush pending X ConfigureNotify events on this window */
+    MsgWaitForMultipleObjectsEx( 0, NULL, 0, 0, 0 );
     TRACE( "hwnd %p, swp (%i,%i)-(%i,%i) flags %08x\n",
            winpos->hwnd, winpos->x, winpos->y,
            winpos->x + winpos->cx, winpos->y + winpos->cy, winpos->flags);

More information about the wine-patches mailing list