winex11.drv: Use dialog window type again for owned popup windows.

Dmitry Timoshkov dmitry at codeweavers.com
Tue Apr 19 07:03:35 CDT 2011


This patch fixes the regression reported in the bug 26693, and the game
in the bug 26508 is still able to make its main window fullscreen.

This is a workaround for Metacity bugs
https://bugzilla.gnome.org/show_bug.cgi?id=648079
https://bugzilla.gnome.org/show_bug.cgi?id=648080
---
 dlls/winex11.drv/window.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 15ee1c2..8298d9d 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1173,7 +1173,24 @@ static void set_wm_hints( Display *display, struct x11drv_win_data *data )
     /* size hints */
     set_size_hints( display, data, style );
 
-    window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+    /* set the WM_WINDOW_TYPE */
+    if (style & WS_THICKFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+    else if (ex_style & WS_EX_APPWINDOW) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+    else if (style & WS_MINIMIZEBOX) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+    else if (style & WS_DLGFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
+    else if (ex_style & WS_EX_DLGMODALFRAME) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
+    /* many window managers don't handle utility windows very well, so we don't use TYPE_UTILITY here */
+    else if (ex_style & WS_EX_TOOLWINDOW) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+    else if ((style & WS_POPUP) && owner) window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_DIALOG);
+    else window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+
+    /* Only use dialog type for owned popups. Metacity allows making fullscreen
+     * only normal windows, and doesn't handle correctly TRANSIENT_IF hint for
+     * dialogs owned by fullscreen windows.
+     */
+    if (!GetWindow( data->hwnd, GW_OWNER ))
+        window_type = x11drv_atom(_NET_WM_WINDOW_TYPE_NORMAL);
+
     XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_WINDOW_TYPE),
 		    XA_ATOM, 32, PropModeReplace, (unsigned char*)&window_type, 1);
 
-- 
1.7.4.3




More information about the wine-patches mailing list