From ba3156097001659df7c60e717c9afa6a4aa2e891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 11 Nov 2020 10:17:59 +0100 Subject: [PATCH] wayland: Bail loudly if invalid geometry is set There is some bug somewhere where the geometry ends up being correct. Mutter didn't handle this gracefully, and is to be changed to simply respect the protocol and error out the client that sends bogus data. Prepare for this by instead of sending bogus data, complain loudly if it would happen dropping the invalid geometry on the floor instead of sending it. Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1527 --- gdk/wayland/gdkwindow-wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 045368797d..811b37ce5c 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1349,6 +1349,9 @@ gdk_wayland_window_sync_margin (GdkWindow *window) return; gdk_wayland_window_get_window_geometry (window, &geometry); + + g_return_if_fail (geometry.width > 0 && geometry.height > 0); + gdk_window_set_geometry_hints (window, &impl->geometry_hints, impl->geometry_mask);