[mutter] wayland/xdg-shell: Warn on invalid effective geometry



commit a40ab5650bc20d6a91b106766160cb719a6593cb
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Nov 13 08:50:57 2020 +0100

    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>

 src/wayland/meta-wayland-xdg-shell.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 4a173d3133..5548e558c2 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -1590,6 +1590,15 @@ meta_wayland_xdg_surface_post_apply_state (MetaWaylandSurfaceRole  *surface_role
       meta_wayland_shell_surface_determine_geometry (shell_surface,
                                                      &pending->new_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;
     }
   else if (!priv->has_set_geometry)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]