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;