winex11.drv: Don't change net_wm maximized state for minimized windows.

Vincent Povirk madewokherd at gmail.com
Fri Jul 17 16:07:12 CDT 2015


In Win32, minimized windows are generally not considered maximized,
but restoring a minimized window that had been maximized returns it to
the maximized state.

In X11, at least with some window managers (I tested metacity and
gnome shell), the maximized state is meaningful for minimized windows.
If we remove the net_wm maximized state from windows we minimize, they
will still be unmaximized when the WM restores them.

To reproduce this problem:
 * Open notepad, and maximize it.
 * Press Alt+F and the left arrow key to open the window system menu.
 * Select "Minimize" from the menu.
 * Restore the window.

When restored, the window is no longer maximized. This only happens if
the window was minimized by Wine, not by the WM.
-------------- next part --------------
From 76cebfff9d52a103586951910cdc1e6d41f72d24 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Fri, 17 Jul 2015 15:48:24 -0500
Subject: [PATCH] winex11.drv: Don't change net_wm maximized state for
 minimized windows.

---
 dlls/winex11.drv/window.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 50c3290..7651590 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -976,7 +976,7 @@ void update_net_wm_states( struct x11drv_win_data *data )
 
     style = GetWindowLongW( data->hwnd, GWL_STYLE );
     if (style & WS_MINIMIZE)
-        new_state |= data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN);
+        new_state |= data->net_wm_state & ((1 << NET_WM_STATE_FULLSCREEN)|(1 << NET_WM_STATE_MAXIMIZED));
     if (is_window_rect_fullscreen( &data->whole_rect ))
     {
         if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION)
-- 
2.1.4



More information about the wine-patches mailing list