winewayland.drv: Respect the compositor requested surface config.

If we are processing a config request by the compositor, consider that
config as authoritative for the window. Otherwise use the window state
to determine the new Wayland state to apply.
This commit is contained in:
Alexandros Frantzis 2023-09-29 13:25:38 +03:00 committed by Alexandre Julliard
parent 85844ff5b4
commit e1222ac33a

View file

@ -196,7 +196,7 @@ static void wayland_win_data_update_wayland_state(struct wayland_win_data *data)
{
struct wayland_surface *surface = data->wayland_surface;
uint32_t window_state;
struct wayland_surface_config *conf;
BOOL processing_config;
pthread_mutex_lock(&surface->mutex);
@ -206,24 +206,34 @@ static void wayland_win_data_update_wayland_state(struct wayland_win_data *data)
(NtUserGetWindowLongW(surface->hwnd, GWL_STYLE) & WS_MAXIMIZE) ?
WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED : 0;
conf = surface->processing.serial ? &surface->processing : &surface->current;
processing_config = surface->processing.serial &&
!surface->processing.processed;
TRACE("hwnd=%p window_state=%#x conf->state=%#x\n",
data->hwnd, window_state, conf->state);
TRACE("hwnd=%p window_state=%#x %s->state=%#x\n",
data->hwnd, window_state,
processing_config ? "processing" : "current",
processing_config ? surface->processing.state : surface->current.state);
if ((window_state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) &&
!(conf->state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED))
/* If we are not processing a compositor requested config, use the
* window state to determine and update the Wayland state. */
if (!processing_config)
{
xdg_toplevel_set_maximized(surface->xdg_toplevel);
if ((window_state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) &&
!(surface->current.state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED))
{
xdg_toplevel_set_maximized(surface->xdg_toplevel);
}
else if (!(window_state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) &&
(surface->current.state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED))
{
xdg_toplevel_unset_maximized(surface->xdg_toplevel);
}
}
else if (!(window_state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED) &&
(conf->state & WAYLAND_SURFACE_CONFIG_STATE_MAXIMIZED))
else
{
xdg_toplevel_unset_maximized(surface->xdg_toplevel);
surface->processing.processed = TRUE;
}
conf->processed = TRUE;
out:
pthread_mutex_unlock(&surface->mutex);
wl_display_flush(process_wayland.wl_display);