1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winewayland.drv: Handle xdg_toplevel tiled states.

Tiled states don't place strict constraints on the surface size, but
they indicate a strong size preference, so try to respect it.
This commit is contained in:
Alexandros Frantzis 2023-09-29 13:36:53 +03:00 committed by Alexandre Julliard
parent e1222ac33a
commit 52decb1ca6
3 changed files with 15 additions and 3 deletions

View file

@ -91,6 +91,12 @@ static void xdg_toplevel_handle_configure(void *data,
case XDG_TOPLEVEL_STATE_RESIZING:
config_state |= WAYLAND_SURFACE_CONFIG_STATE_RESIZING;
break;
case XDG_TOPLEVEL_STATE_TILED_LEFT:
case XDG_TOPLEVEL_STATE_TILED_RIGHT:
case XDG_TOPLEVEL_STATE_TILED_TOP:
case XDG_TOPLEVEL_STATE_TILED_BOTTOM:
config_state |= WAYLAND_SURFACE_CONFIG_STATE_TILED;
break;
default:
break;
}

View file

@ -60,7 +60,8 @@ enum wayland_window_message
enum wayland_surface_config_state
{
WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED = (1 << 0),
WAYLAND_SURFACE_CONFIG_STATE_RESIZING = (1 << 1)
WAYLAND_SURFACE_CONFIG_STATE_RESIZING = (1 << 1),
WAYLAND_SURFACE_CONFIG_STATE_TILED = (1 << 2)
};
struct wayland_cursor

View file

@ -401,8 +401,13 @@ static void wayland_configure_window(HWND hwnd)
}
/* The Wayland maximized state is very strict about surface size, so don't
* let the application override it. */
if (state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) flags |= SWP_NOSENDCHANGING;
* let the application override it. The tiled state is not as strict,
* but it indicates a strong size preference, so try to respect it. */
if (state & (WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED |
WAYLAND_SURFACE_CONFIG_STATE_TILED))
{
flags |= SWP_NOSENDCHANGING;
}
NtUserSetWindowPos(hwnd, 0, 0, 0, width, height, flags);
}