[PATCH 1/2] winex11.drv: Remove frame when non-client area is empty.

Rémi Bernon rbernon at codeweavers.com
Mon Mar 16 17:12:33 CDT 2020

Several applications -Steam, Battle.net for instance- handle the
WM_NCCALCSIZE message to override the non-client areas size and make
the client area cover the whole window, instead of changing the styles.

In winex11.drv, in decorated mode, we adjust the window rect according
to the window style to hide the unwanted decorations behind the frame,
but when client and window rects are equals, there's nothing to hide
and the actual window styles are irrelevant and can safely be ignored.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40930
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>

There's still going to be some issues for applications that customize
the non-client area sizes differently from their styles, but hopefully
there's aren't many applications that do that.

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

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 99e4094ebd9..903b036442b 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -286,6 +286,7 @@ static unsigned long get_mwm_decorations( struct x11drv_win_data *data,
     if (!decorated_mode) return 0;
+    if (EqualRect( &data->window_rect, &data->client_rect )) return 0;
     if (IsRectEmpty( &data->window_rect )) return 0;
     if (data->shaped) return 0;

More information about the wine-devel mailing list