winex11.drv: Map zero-sized windows but don't add WM decoration to them

Dmitry Timoshkov dmitry at codeweavers.com
Wed Apr 16 02:50:29 CDT 2008


Hello,

this patch fixes the bug 12264 for me. What still doesn't work under Metacity
is minimize then restore using the application button on the WM task bar, but
this doesn't work for me only if there are no other active windows, otherwise
it does work.

Changelog:
    winex11.drv: Map zero-sized windows but don't add WM decoration to them.
---
 dlls/winex11.drv/window.c |   11 +++++++----
 dlls/winex11.drv/winpos.c |    3 ---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index b62da2d..da91978 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -123,11 +123,14 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl
 /***********************************************************************
  *              get_mwm_decorations
  */
-static unsigned long get_mwm_decorations( DWORD style, DWORD ex_style )
+static unsigned long get_mwm_decorations( struct x11drv_win_data *data,
+                                          DWORD style, DWORD ex_style )
 {
     unsigned long ret = 0;
 
-    if (!decorated_mode) return ret;
+    if (!decorated_mode) return 0;
+
+    if (IsRectEmpty( &data->window_rect )) return 0;
 
     if (ex_style & WS_EX_TOOLWINDOW) return 0;
 
@@ -159,7 +162,7 @@ static void get_x11_rect_offset( struct x11drv_win_data *data, RECT *rect )
 
     style = GetWindowLongW( data->hwnd, GWL_STYLE );
     ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
-    decor = get_mwm_decorations( style, ex_style );
+    decor = get_mwm_decorations( data, style, ex_style );
 
     if (decor & MWM_DECOR_TITLE) style_mask |= WS_CAPTION;
     if (decor & MWM_DECOR_BORDER)
@@ -855,7 +858,7 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data )
 		    XA_ATOM, 32, PropModeReplace, (unsigned char*)&window_type, 1);
 
     mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
-    mwm_hints.decorations = get_mwm_decorations( style, ex_style );
+    mwm_hints.decorations = get_mwm_decorations( data, style, ex_style );
     mwm_hints.functions = MWM_FUNC_MOVE;
     if (is_window_resizable( data, style )) mwm_hints.functions |= MWM_FUNC_RESIZE;
     if (style & WS_MINIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MINIMIZE;
diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c
index f36bc98..3689330 100644
--- a/dlls/winex11.drv/winpos.c
+++ b/dlls/winex11.drv/winpos.c
@@ -293,9 +293,6 @@ void make_window_embedded( Display *display, struct x11drv_win_data *data )
  */
 static BOOL is_window_rect_mapped( const RECT *rect )
 {
-    /* don't map if rect is empty */
-    if (IsRectEmpty( rect )) return FALSE;
-
     /* don't map if rect is off-screen */
     if (rect->left >= virtual_screen_rect.right ||
         rect->top >= virtual_screen_rect.bottom ||
-- 
1.5.4.5






More information about the wine-patches mailing list