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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2604>
This commit is contained in:
Jonas Ådahl 2022-09-01 23:02:00 +02:00 committed by Marge Bot
parent 73bb333000
commit eb764e0f0d
2 changed files with 6 additions and 8 deletions

View File

@ -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;
}

View File

@ -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;