Commit e1222ac3 authored by Alexandros Frantzis's avatar Alexandros Frantzis Committed by Alexandre Julliard

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