http://bugs.winehq.org/show_bug.cgi?id=3298
Summary: Word 95: Dialog boxes are unusable (X11 ConfigureNotify problem) Product: Wine Version: CVS Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: wine-x11driver AssignedTo: wine-bugs@winehq.org ReportedBy: hallo@michael-kaufmann.ch
The dialog boxes of Word 95 often appear with the minimal window size (about 70x50 pixels), so they're unusable. With KDE's window manager (KWin) this happens very often. With Enlightenment and GNOME's window manager (Metacity), it only happens from time to time.
I've looked for the reason, and I think it's very closely related to bug 1265 which Duane Clark has tried to fix here: http://www.winehq.com/hypermail/wine-patches/2003/02/0095.html
That's what's going on (CVS version of Wine, managed window mode):
1. Word creates a dialog with an initial position of (0,0) and size 0x0 (using CreateWindowEx) 2. Word calls SetWindowPos to set the correct dialog position and size 3. Word calls SetWindowPos to show the dialog (SWP_SHOWWINDOW) 4. The dialog gets the focus, the main window is being deactivated 5. In the WM_NCACTIVATE procedure of the main window, Word calls GetQueueStatus. Wine will process X events. 6. Wine receives a ConfigureEvent for the initial dialog position and size (0x0) and saves this to data->whole_rect in X11DRV_sync_window_position (7. If you're lucky, WINE also receives a ConfigureEvent for the correct dialog position) 8. Wine shows the dialog and maps it. It calls X11DRV_set_wm_hints, which calls set_size_hints. This procedure uses data->whole_rect as the dialog's rectangle. But this stored rectangle is completely wrong because WINE has not yet received all ConfigureEvents. 9. The window manager has to resize the dialog to the wrong size.
I've not yet managed to write a simple test program; it seems that the timing is very important for this bug to appear.
How this bug could be fixed:
- Process all X events before setting the window position in SetWindowPos, but I don't know if that's possible. - Don't handle X events in MsgWaitForMultipleObjectsEx, just wait for them (won't fix the actual bug but will probably fix the problem for Word 95). - Don't cache the X11 window rectangle and always use XGetGeometry to get the current window rectangle (efficiency loss)
If you really need Word 95, you may apply this patch which breaks other applications but works fine with Word 95: http://www.winehq.com/hypermail/wine-devel/2005/08/0346.html