Commit 89c36c11 authored by Alexandros Frantzis's avatar Alexandros Frantzis Committed by Alexandre Julliard

winewayland.drv: Avoid resizing fullscreen windows.

If the window is already fullscreen and its size is compatible with what the compositor is requesting, don't force a resize, since some applications are very insistent on a particular fullscreen size (which may not match the monitor size).
parent 26c7dfb7
...@@ -324,9 +324,9 @@ void wayland_surface_attach_shm(struct wayland_surface *surface, ...@@ -324,9 +324,9 @@ void wayland_surface_attach_shm(struct wayland_surface *surface,
* Checks whether a wayland_surface_config object is compatible with the * Checks whether a wayland_surface_config object is compatible with the
* the provided arguments. * the provided arguments.
*/ */
static BOOL wayland_surface_config_is_compatible(struct wayland_surface_config *conf, BOOL wayland_surface_config_is_compatible(struct wayland_surface_config *conf,
int width, int height, int width, int height,
enum wayland_surface_config_state state) enum wayland_surface_config_state state)
{ {
static enum wayland_surface_config_state mask = static enum wayland_surface_config_state mask =
WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED; WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED;
......
...@@ -201,6 +201,9 @@ void wayland_surface_attach_shm(struct wayland_surface *surface, ...@@ -201,6 +201,9 @@ void wayland_surface_attach_shm(struct wayland_surface *surface,
HRGN surface_damage_region) DECLSPEC_HIDDEN; HRGN surface_damage_region) DECLSPEC_HIDDEN;
struct wayland_surface *wayland_surface_lock_hwnd(HWND hwnd) DECLSPEC_HIDDEN; struct wayland_surface *wayland_surface_lock_hwnd(HWND hwnd) DECLSPEC_HIDDEN;
BOOL wayland_surface_reconfigure(struct wayland_surface *surface) DECLSPEC_HIDDEN; BOOL wayland_surface_reconfigure(struct wayland_surface *surface) DECLSPEC_HIDDEN;
BOOL wayland_surface_config_is_compatible(struct wayland_surface_config *conf,
int width, int height,
enum wayland_surface_config_state state) DECLSPEC_HIDDEN;
/********************************************************************** /**********************************************************************
* Wayland SHM buffer * Wayland SHM buffer
......
...@@ -434,6 +434,21 @@ static void wayland_configure_window(HWND hwnd) ...@@ -434,6 +434,21 @@ static void wayland_configure_window(HWND hwnd)
flags |= SWP_FRAMECHANGED; flags |= SWP_FRAMECHANGED;
} }
/* If the window is already fullscreen and its size is compatible with what
* the compositor is requesting, don't force a resize, since some applications
* are very insistent on a particular fullscreen size (which may not match
* the monitor size). */
if ((surface->window.state & WAYLAND_SURFACE_CONFIG_STATE_FULLSCREEN) &&
wayland_surface_config_is_compatible(&surface->processing,
surface->window.rect.right -
surface->window.rect.left,
surface->window.rect.bottom -
surface->window.rect.top,
surface->window.state))
{
flags |= SWP_NOSIZE;
}
pthread_mutex_unlock(&surface->mutex); pthread_mutex_unlock(&surface->mutex);
TRACE("processing=%dx%d,%#x\n", width, height, state); TRACE("processing=%dx%d,%#x\n", width, height, state);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment