wayland/xdg-shell: Warn on invalid effective geometry

It isn't allowed to provide empty window geometries; warn if a client
violates this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1557>
This commit is contained in:
Jonas Ådahl 2020-11-13 08:50:57 +01:00 committed by Marge Bot
parent a54970805d
commit a40ab5650b

View File

@ -1590,6 +1590,15 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole *surface_role
meta_wayland_shell_surface_determine_geometry (shell_surface, meta_wayland_shell_surface_determine_geometry (shell_surface,
&pending->new_geometry, &pending->new_geometry,
&priv->geometry); &priv->geometry);
if (priv->geometry.width == 0 || priv->geometry.height == 0)
{
g_warning ("Invalid window geometry for xdg_surface@%d. Ignoring "
"for now, but this will result in client termination "
"in the future.",
wl_resource_get_id (priv->resource));
return;
}
priv->has_set_geometry = TRUE; priv->has_set_geometry = TRUE;
} }
else if (!priv->has_set_geometry) else if (!priv->has_set_geometry)