winex11.drv: Do not remove the decorations from a fullscreen window.

Dmitry Timoshkov dmitry at codeweavers.com
Thu Apr 21 06:00:07 CDT 2011


Many WMs create a separate window for window decorations, so adding
or removing a caption/border leads to unwanted unmap/map/focus events.
Do not request removing decoratios from a fullscreen window since
WM is supposed to do that already.

This is another version of a fix for the problem reported in the bug 26017
that the game 3D Pinball can't enter fullscreen mode correctly.
---
 dlls/winex11.drv/window.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 2e05f7c..0e7b310 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1151,9 +1151,20 @@ static Window get_owner_whole_window( HWND owner, BOOL force_managed )
 
 
 /***********************************************************************
+ *		is_window_fullscreen
+ *
+ * Check if the window is in fullscreen state
+ */
+static inline BOOL is_window_fullscreen( struct x11drv_win_data *data )
+{
+    return (data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN));
+}
+
+
+/***********************************************************************
  *              set_wm_hints
  *
- * Set the window manager hints for a newly-created window
+ * Update the window manager hints for a window
  */
 static void set_wm_hints( Display *display, struct x11drv_win_data *data )
 {
@@ -1196,8 +1207,15 @@ static void set_wm_hints( Display *display, struct x11drv_win_data *data )
     XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_WINDOW_TYPE),
 		    XA_ATOM, 32, PropModeReplace, (unsigned char*)&window_type, 1);
 
-    mwm_hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS;
+    mwm_hints.flags = MWM_HINTS_FUNCTIONS;
     mwm_hints.decorations = get_mwm_decorations( data, style, ex_style );
+    /* Many WMs create a separate window for window decorations, so adding
+     * or removing a caption/border leads to unwanted unmap/map/focus events.
+     * Do not request removing decoratios from a fullscreen window since
+     * WM is supposed to do that already.
+     */
+    if (!(is_window_fullscreen( data ) && !mwm_hints.decorations))
+        mwm_hints.flags |= MWM_HINTS_DECORATIONS;
     mwm_hints.functions = MWM_FUNC_MOVE;
     if (is_window_resizable( data, style )) mwm_hints.functions |= MWM_FUNC_RESIZE;
     if (!(style & WS_DISABLED))
-- 
1.7.4.3




More information about the wine-patches mailing list