Gabriel Ivăncescu : winex11.drv: Always enable minimize/maximize functions for minimized windows.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 15:40:35 CST 2020


Module: wine
Branch: master
Commit: 688fe7068c689050d1100e0b2702367eb3180c53
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=688fe7068c689050d1100e0b2702367eb3180c53

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Fri Nov 13 15:26:18 2020 +0200

winex11.drv: Always enable minimize/maximize functions for minimized windows.

A window without a minimize or maximize box can still be programmatically
minimized by the Windows API. However, some WMs will refuse to change the
state and not allow it to be maximized again, despite it being minimized,
due to lacking those functions, thus not sending WM_STATE change notifications
when clicking the minimized window on the taskbar.

Heroes of Might and Magic V does this, for example, when losing focus. It
minimizes itself. When maximizing it by clicking on the taskbar it won't
send a WM_STATE change notification (since it was never changed) and fail
to maximize properly, showing a black screen (the game will still think it
is minimized).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/window.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index ba722721ad2..f46cbfb088a 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -752,6 +752,10 @@ static void set_mwm_hints( struct x11drv_win_data *data, DWORD style, DWORD ex_s
             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;
+
+            /* The window can be programmatically minimized even without
+               a minimize box button. Allow the WM to restore it. */
+            if (style & WS_MINIMIZE)    mwm_hints.functions |= MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE;
         }
     }
 




More information about the wine-cvs mailing list