[gtk/gtk-3-24: 1/2] wayland: Bail loudly if invalid geometry is set
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 1/2] wayland: Bail loudly if invalid geometry is set
- Date: Wed, 11 Nov 2020 15:18:29 +0000 (UTC)
commit ba3156097001659df7c60e717c9afa6a4aa2e891
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Nov 11 10:17:59 2020 +0100
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]