From: Etaash Mathamsetty <etaash.mathamsetty@gmail.com> --- dlls/winewayland.drv/wayland_surface.c | 14 +++++++++----- dlls/winewayland.drv/window.c | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/winewayland.drv/wayland_surface.c b/dlls/winewayland.drv/wayland_surface.c index b2a0f9d9836..288c1ab1b04 100644 --- a/dlls/winewayland.drv/wayland_surface.c +++ b/dlls/winewayland.drv/wayland_surface.c @@ -484,6 +484,14 @@ BOOL wayland_surface_config_is_compatible(struct wayland_surface_config *conf, static enum wayland_surface_config_state mask = WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED; + /* The fullscreen state requires a size smaller or equal to the configured + * size. If we have a larger size, we can use surface geometry during + * surface reconfiguration to provide the smaller size, so we are always + * compatible with a fullscreen state. + * NOTE: Fullscreen combined with maximized is the same as fullscreen. */ + if (conf->state & WAYLAND_SURFACE_CONFIG_STATE_FULLSCREEN) + return TRUE; + /* We require the same state. */ if ((state & mask) != (conf->state & mask)) return FALSE; @@ -496,11 +504,6 @@ BOOL wayland_surface_config_is_compatible(struct wayland_surface_config *conf, return FALSE; } - /* The fullscreen state requires a size smaller or equal to the configured - * size. If we have a larger size, we can use surface geometry during - * surface reconfiguration to provide the smaller size, so we are always - * compatible with a fullscreen state. */ - return TRUE; } @@ -554,6 +557,7 @@ static void wayland_surface_reconfigure_geometry(struct wayland_surface *surface /* If the window rect in the monitor is smaller than required, * fall back to an appropriately sized rect at the top-left. */ if ((surface->current.state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) && + !(surface->current.state & WAYLAND_SURFACE_CONFIG_STATE_FULLSCREEN) && (rect.right - rect.left < surface->current.width || rect.bottom - rect.top < surface->current.height)) { diff --git a/dlls/winewayland.drv/window.c b/dlls/winewayland.drv/window.c index eb0ff222bf2..e3b3b0bed46 100644 --- a/dlls/winewayland.drv/window.c +++ b/dlls/winewayland.drv/window.c @@ -620,7 +620,8 @@ static void wayland_configure_window(HWND hwnd) if (window_width == 0 || window_height == 0) flags |= SWP_NOSIZE; style = NtUserGetWindowLongW(hwnd, GWL_STYLE); - if (!(state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) != !(style & WS_MAXIMIZE)) + if (!(state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) != !(style & WS_MAXIMIZE) + && !(state & WAYLAND_SURFACE_CONFIG_STATE_FULLSCREEN)) NtUserSetWindowLong(hwnd, GWL_STYLE, style ^ WS_MAXIMIZE, FALSE); /* The Wayland maximized and fullscreen states are very strict about -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11131