[gtk/inspector-menu-fix: 1/4] seat: Add a sanity check
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/inspector-menu-fix: 1/4] seat: Add a sanity check
- Date: Wed, 1 May 2019 20:55:43 +0000 (UTC)
commit 6f0b47681b877c0f2ea6e635ff600af30f99d24a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 1 20:46:02 2019 +0000
seat: Add a sanity check
apis that takes multiple display-relative objects
should make sure that they are all from the same
display, or hard-to-track-down badness will happen
later on.
Add such a check for the surface and device arguments
of gdk_seat_grab. This helped in tracking down
critical warnings from combo boxes in the inspector.
gdk/gdkseat.c | 1 +
1 file changed, 1 insertion(+)
---
diff --git a/gdk/gdkseat.c b/gdk/gdkseat.c
index ee88c6c4f2..c13fbed615 100644
--- a/gdk/gdkseat.c
+++ b/gdk/gdkseat.c
@@ -293,6 +293,7 @@ gdk_seat_grab (GdkSeat *seat,
g_return_val_if_fail (GDK_IS_SEAT (seat), GDK_GRAB_FAILED);
g_return_val_if_fail (GDK_IS_SURFACE (surface), GDK_GRAB_FAILED);
+ g_return_val_if_fail (gdk_surface_get_display (surface) == gdk_seat_get_display (seat), GDK_GRAB_FAILED);
capabilities &= GDK_SEAT_CAPABILITY_ALL;
g_return_val_if_fail (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]