From eb764e0f0d0a77b2c0729804ae00fad1b3768176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 1 Sep 2022 23:02:00 +0200 Subject: [PATCH] barrier/x11: Let the seat bind the input events for us Without doing this, the events bound by the X11 barrier manager will get overridden by the ones later bound by the seat. Fixes: 0debb24e12d7b2f60d489b31981019f5f7b9b508 Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2394 Part-of: --- src/backends/x11/meta-barrier-x11.c | 8 -------- src/backends/x11/meta-seat-x11.c | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/backends/x11/meta-barrier-x11.c b/src/backends/x11/meta-barrier-x11.c index 45ea1421b..e63c3096b 100644 --- a/src/backends/x11/meta-barrier-x11.c +++ b/src/backends/x11/meta-barrier-x11.c @@ -212,20 +212,12 @@ meta_barrier_impl_x11_init (MetaBarrierImplX11 *self) MetaX11Barriers * meta_x11_barriers_new (MetaBackendX11 *backend_x11) { - Display *xdisplay = meta_backend_x11_get_xdisplay (backend_x11); - Window root = meta_backend_x11_get_root_xwindow (backend_x11); MetaX11Barriers *x11_barriers; - unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = {}; - XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits }; x11_barriers = g_new0 (MetaX11Barriers, 1); x11_barriers->barriers = g_hash_table_new (meta_unsigned_long_hash, meta_unsigned_long_equal); - XISetMask (mask.mask, XI_BarrierHit); - XISetMask (mask.mask, XI_BarrierLeave); - XISelectEvents (xdisplay, root, &mask, 1); - return x11_barriers; } diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c index c8e690faa..e972c80c6 100644 --- a/src/backends/x11/meta-seat-x11.c +++ b/src/backends/x11/meta-seat-x11.c @@ -1441,6 +1441,12 @@ meta_seat_x11_constructed (GObject *object) XISetMask (mask, XI_RawButtonPress); XISetMask (mask, XI_RawButtonRelease); + if (meta_backend_x11_get_barriers (META_BACKEND_X11 (seat_x11->backend))) + { + XISetMask (mask, XI_BarrierHit); + XISetMask (mask, XI_BarrierLeave); + } + event_mask.deviceid = XIAllMasterDevices; event_mask.mask_len = sizeof (mask); event_mask.mask = mask;