Commit c623902e authored by Philipp Kerling's avatar Philipp Kerling Committed by Quentin Glidic

libweston-desktop/xdg-shell: Check window geometry instead of surface size against configured size

Shell surfaces may have a geometry that is different to the size of
their main surface, e.g. due to subcompositing.

In states where size is strictly enforced (fullscreen and maximized),
the size that the compositor wants must be checked against the window
geometry and not just the main surface size.

Fix by calling weston_desktop_surface_get_geometry and using that size
instead of main surface size.
Signed-off-by: default avatarPhilipp Kerling <pkerling@casix.org>
Reviewed-by: Quentin Glidic's avatarQuentin Glidic <sardemff7+git@sardemff7.net>
parent ba8a0d04
......@@ -264,6 +264,10 @@ weston_desktop_xdg_surface_committed(struct weston_desktop_surface *dsurface,
weston_desktop_surface_get_surface(surface->surface);
bool reconfigure = false;
/* TODO: use the window geometry and not the surface size here
* We need to check the next geometry if there is one, but not accept it
* until we checked it, maybe.
*/
if (surface->next.state.maximized || surface->next.state.fullscreen)
reconfigure = surface->next.size.width != wsurface->width ||
surface->next.size.height != wsurface->height;
......
......@@ -644,9 +644,12 @@ weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplev
if (!wsurface->buffer_ref.buffer)
return;
struct weston_geometry geometry =
weston_desktop_surface_get_geometry(toplevel->base.desktop_surface);
if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) &&
(toplevel->next.size.width != wsurface->width ||
toplevel->next.size.height != wsurface->height)) {
(toplevel->next.size.width != geometry.width ||
toplevel->next.size.height != geometry.height)) {
struct weston_desktop_client *client =
weston_desktop_surface_get_client(toplevel->base.desktop_surface);
struct wl_resource *client_resource =
......
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