winex11.drv: Do not change the decorations of a fullscreen window.
Dmitry Timoshkov
dmitry at codeweavers.com
Fri Apr 1 09:02:07 CDT 2011
Metacity gets confused and does unmap/map a fullscreen window,
even if the decorations didn't change, this leads to an unexpected
FocusOut event.
This is hopefully a more correct 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 | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index e2ffccc..bde018a 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -253,6 +253,17 @@ static inline BOOL is_window_resizable( struct x11drv_win_data *data, DWORD styl
/***********************************************************************
+ * 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));
+}
+
+
+/***********************************************************************
* get_mwm_decorations
*/
static unsigned long get_mwm_decorations( struct x11drv_win_data *data,
@@ -1173,8 +1184,17 @@ 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.decorations = get_mwm_decorations( data, style, ex_style );
+ mwm_hints.flags = 0;
+ /* Metacity gets confused and does unmap/map a fullscreen window,
+ * even if the decorations didn't change, this leads to an unexpected
+ * FocusOut event.
+ */
+ if (!is_window_fullscreen( data ))
+ {
+ mwm_hints.flags |= MWM_HINTS_DECORATIONS;
+ mwm_hints.decorations = get_mwm_decorations( data, style, ex_style );
+ }
+ mwm_hints.flags |= MWM_HINTS_FUNCTIONS;
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.1
More information about the wine-patches
mailing list