Alexandre Julliard : winex11: Tool windows should not have WM decorations.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 29 07:48:13 CDT 2007


Module: wine
Branch: master
Commit: 74cd76c9c7c448a4161b87509e7090848dab8cb4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=74cd76c9c7c448a4161b87509e7090848dab8cb4

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Aug 29 12:02:57 2007 +0200

winex11: Tool windows should not have WM decorations.

---

 dlls/winex11.drv/window.c |   38 ++++++++++++++++++++++++--------------
 1 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 24f89f8..2b56913 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -560,23 +560,26 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data )
 
     mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
     mwm_hints.functions = MWM_FUNC_MOVE;
-    if (style & WS_THICKFRAME) mwm_hints.functions |= MWM_FUNC_RESIZE;
+    if (style & WS_THICKFRAME)  mwm_hints.functions |= MWM_FUNC_RESIZE;
     if (style & WS_MINIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MINIMIZE;
     if (style & WS_MAXIMIZEBOX) mwm_hints.functions |= MWM_FUNC_MAXIMIZE;
-    if (style & WS_SYSMENU)    mwm_hints.functions |= MWM_FUNC_CLOSE;
+    if (style & WS_SYSMENU)     mwm_hints.functions |= MWM_FUNC_CLOSE;
     mwm_hints.decorations = 0;
-    if ((style & WS_CAPTION) == WS_CAPTION) 
+    if (!(ex_style & WS_EX_TOOLWINDOW))
     {
-	mwm_hints.decorations |= MWM_DECOR_TITLE;
-	if (style & WS_SYSMENU) mwm_hints.decorations |= MWM_DECOR_MENU;
-	if (style & WS_MINIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MINIMIZE;
-	if (style & WS_MAXIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MAXIMIZE;
+        if ((style & WS_CAPTION) == WS_CAPTION)
+        {
+            mwm_hints.decorations |= MWM_DECOR_TITLE;
+            if (style & WS_SYSMENU) mwm_hints.decorations |= MWM_DECOR_MENU;
+            if (style & WS_MINIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MINIMIZE;
+            if (style & WS_MAXIMIZEBOX) mwm_hints.decorations |= MWM_DECOR_MAXIMIZE;
+        }
+        if (ex_style & WS_EX_DLGMODALFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
+        else if (style & WS_THICKFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH;
+        else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
+        else if (style & WS_BORDER) mwm_hints.decorations |= MWM_DECOR_BORDER;
+        else if (!(style & (WS_CHILD|WS_POPUP))) mwm_hints.decorations |= MWM_DECOR_BORDER;
     }
-    if (ex_style & WS_EX_DLGMODALFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
-    else if (style & WS_THICKFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER | MWM_DECOR_RESIZEH;
-    else if ((style & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME) mwm_hints.decorations |= MWM_DECOR_BORDER;
-    else if (style & WS_BORDER) mwm_hints.decorations |= MWM_DECOR_BORDER;
-    else if (!(style & (WS_CHILD|WS_POPUP))) mwm_hints.decorations |= MWM_DECOR_BORDER;
 
     XChangeProperty( display, data->whole_window, x11drv_atom(_MOTIF_WM_HINTS),
                      x11drv_atom(_MOTIF_WM_HINTS), 32, PropModeReplace,
@@ -650,14 +653,17 @@ void X11DRV_set_iconic_state( HWND hwnd )
 void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
 {
     RECT rc;
+    DWORD ex_style;
 
     if (!data->managed) return;
     if (IsRectEmpty( rect )) return;
+    ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
+    if (ex_style & WS_EX_TOOLWINDOW) return;
 
     rc.top = rc.bottom = rc.left = rc.right = 0;
 
     AdjustWindowRectEx( &rc, GetWindowLongW( data->hwnd, GWL_STYLE ) & ~(WS_HSCROLL|WS_VSCROLL),
-                        FALSE, GetWindowLongW( data->hwnd, GWL_EXSTYLE ) );
+                        FALSE, ex_style );
 
     rect->left   -= rc.left;
     rect->right  -= rc.right;
@@ -675,11 +681,15 @@ void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect )
  */
 void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect )
 {
+    DWORD ex_style;
+
     if (!data->managed) return;
     if (IsRectEmpty( rect )) return;
+    ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
+    if (ex_style & WS_EX_TOOLWINDOW) return;
 
     AdjustWindowRectEx( rect, GetWindowLongW( data->hwnd, GWL_STYLE ) & ~(WS_HSCROLL|WS_VSCROLL),
-                        FALSE, GetWindowLongW( data->hwnd, GWL_EXSTYLE ));
+                        FALSE, ex_style );
 
     if (rect->top >= rect->bottom) rect->bottom = rect->top + 1;
     if (rect->left >= rect->right) rect->right = rect->left + 1;




More information about the wine-cvs mailing list