diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-11-11 10:17:59 +0100 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-11-11 10:17:59 +0100 |
commit | ba3156097001659df7c60e717c9afa6a4aa2e891 (patch) | |
tree | f812e5d17da14935978d18677f466a398a19e2b4 | |
parent | cfd21b099122e501ea76c090b9f51b0c6824ebaa (diff) | |
download | gtk+-ba3156097001659df7c60e717c9afa6a4aa2e891.tar.gz |
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
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |