Duane Clark dclark@akamail.com writes:
Changelog: Before changing window size/pos, handle pending ConfigureNotify events.
That's only hiding the problem, and only in some cases. There is no guarantee that the ConfigureNotify has arrived by the time we do the resize, so we need to cope with a ConfigureNotify arriving at any time.
Alexandre Julliard wrote:
Duane Clark dclark@akamail.com writes:
Changelog: Before changing window size/pos, handle pending ConfigureNotify events.
That's only hiding the problem, and only in some cases. There is no guarantee that the ConfigureNotify has arrived by the time we do the resize, so we need to cope with a ConfigureNotify arriving at any time.
Okay, that will certainly be more ...err... challenging ;) I will see what I can do.
ons, 2003-02-19 kl. 01:29 skrev Duane Clark:
Alexandre Julliard wrote:
Duane Clark dclark@akamail.com writes:
Changelog: Before changing window size/pos, handle pending ConfigureNotify events.
That's only hiding the problem, and only in some cases. There is no guarantee that the ConfigureNotify has arrived by the time we do the resize, so we need to cope with a ConfigureNotify arriving at any time.
Okay, that will certainly be more ...err... challenging ;) I will see what I can do.
Also consider the current solution in WineX. It uses XPeekEvent inside EVENT_ProcessEvent to detect a sequence of consecutive ConfigureNotify events in the queue, and only process the last one. Since EVENT_ProcessEvent is only called after the app is done with its window management stuff and starts processing events, the last event is more likely to have arrived by that time (at least in that game we had to do this hack for, where the event loop started several seconds after a bunch of window changes, which included showing/hiding, so we also try to eliminate UnmapWindow/MapWindow pairs in the queue in WineX to avoid getting the window minimized).
But it'd still not be reliable without being able to somehow track all the pending ConfigureWindow/ConfigureNotify events, which is next to impossible when dealing with an unknown window manager.
On Tuesday 18 February 2003 02:47 pm, Alexandre Julliard wrote:
Changelog: Before changing window size/pos, handle pending ConfigureNotify events.
That's only hiding the problem, and only in some cases. There is no guarantee that the ConfigureNotify has arrived by the time we do the resize, so we need to cope with a ConfigureNotify arriving at any time.
Given that resolving this problem in the correct way will be complex and happen over the long term, and that Duane's very simple patch does indeed resolve the bugs in question:
http://bugs.winehq.com/show_bug.cgi?id=1265 http://bugs.winehq.com/show_bug.cgi?id=1266
while not adversely affecting other applications, would you consider committing this patch anyway? In the future, when ConfigureNotify events are properly handled and the Wine code is being optimized, this code can be removed as it will be redundant. Until then, it does make Visual FoxPro appear to behave correctly, which is an important selling point for me in trying to convince other VFP developers to move to Linux/Wine.
Thanks for your time and consideration Alexandre, and kudos to you and all the other Wine developers for bringing the product to its current quite usable and functional state!
For your reference, here is a link to the patch in question: http://www.winehq.com/hypermail/wine-patches/2003/02/0159.html
And here is a text copy of the actual patch:
Changelog: Before changing window size/pos, handle pending ConfigureNotify events.
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);