Stricter check whether a window needs to be mapped on the screen
Dmitry Timoshkov
dmitry at baikal.ru
Wed Nov 2 07:44:21 CST 2005
Hello,
(for some reason I don't see this patch in wine-patches, thus resending)
this patch fixes a problem with minimization in Lotus Notes.
1. One presses minimize button.
2. WM sends FocusOut event
3. x11drv generates WM_ACTIVATE(0) message
4. Notes calls DrawMenuBar in order to repaint its custom caption
5. DrawMenuBar calls SetWindowPos with SWP_NOSIZE set, but X11DRV_set_window_pos
calls XMapWindow which schedules MapNotify event.
6. WM sends UnmapNotify event, x11drv generates WM_SHOWWINDOW/SW_MINIMIZE
and everything else needed to minimize the window.
7. x11drv receives scheduled MapNotify event and restores the window.
The patch fixes the bug by taking into account WS_MINIMIZE before mapping
a window (as already done in X11DRV_SetWindowStyle), and SWP_NOSIZE | SWP_NOMOVE
to detect the resizing from zero size to non-zero case.
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Stricter check whether a window needs to be mapped on the screen.
--- cvs/hq/wine/dlls/x11drv/winpos.c 2005-09-29 14:05:41.000000000 +0900
+++ wine/dlls/x11drv/winpos.c 2005-11-02 20:13:36.000000000 +0800
@@ -643,7 +643,7 @@ BOOL X11DRV_set_window_pos( HWND hwnd, H
if (data->whole_window && !(swp_flags & SWP_WINE_NOHOSTMOVE))
{
- if (!(old_style & WS_VISIBLE) && (new_style & WS_VISIBLE))
+ if (!(old_style & WS_VISIBLE) && (new_style & WS_VISIBLE) && !(new_style & WS_MINIMIZE))
{
/* window got shown, map it */
if (X11DRV_is_window_rect_mapped( rectWindow ))
@@ -656,13 +656,16 @@ BOOL X11DRV_set_window_pos( HWND hwnd, H
wine_tsx11_unlock();
}
}
- else if ((new_style & WS_VISIBLE) && X11DRV_is_window_rect_mapped( rectWindow ))
+ else if (!(swp_flags & (SWP_NOSIZE | SWP_NOMOVE)) && X11DRV_is_window_rect_mapped( rectWindow ))
{
- /* resizing from zero size to non-zero -> map */
- TRACE( "mapping non zero size or off-screen win %p\n", hwnd );
- wine_tsx11_lock();
- XMapWindow( display, data->whole_window );
- wine_tsx11_unlock();
+ if ((new_style & WS_VISIBLE) && !(new_style & WS_MINIMIZE))
+ {
+ /* resizing from zero size to non-zero -> map */
+ TRACE( "mapping non zero size or off-screen win %p\n", hwnd );
+ wine_tsx11_lock();
+ XMapWindow( display, data->whole_window );
+ wine_tsx11_unlock();
+ }
}
wine_tsx11_lock();
XFlush( display ); /* FIXME: should not be necessary */
More information about the wine-patches
mailing list