barrier: Allow releasing without any event in the native implementation
This allows for a sticky barrier to hold the pointer until it is released, but the owner of the barrier doesn't need a barrier event to release it. It will be used to implement input capturing. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
This commit is contained in:
parent
221ac2af76
commit
a8f461a4eb
@ -640,7 +640,7 @@ meta_barrier_impl_native_release (MetaBarrierImpl *impl,
|
||||
MetaBarrierImplNative *self = META_BARRIER_IMPL_NATIVE (impl);
|
||||
|
||||
if (self->state == META_BARRIER_STATE_HELD &&
|
||||
event->event_id == self->trigger_serial)
|
||||
(!event || event->event_id == self->trigger_serial))
|
||||
{
|
||||
self->state = META_BARRIER_STATE_RELEASE;
|
||||
self->manager->pointer_trap = NULL;
|
||||
|
@ -75,6 +75,12 @@ meta_barrier_impl_x11_release (MetaBarrierImpl *impl,
|
||||
MetaBackendX11 *backend_x11 = META_BACKEND_X11 (backend);
|
||||
Display *xdisplay = meta_backend_x11_get_xdisplay (backend_x11);
|
||||
|
||||
if (!event)
|
||||
{
|
||||
g_warning ("X11 barriers always need barrier events to release");
|
||||
return;
|
||||
}
|
||||
|
||||
XIBarrierReleasePointer (xdisplay,
|
||||
META_VIRTUAL_CORE_POINTER_ID,
|
||||
self->xbarrier, event->event_id);
|
||||
|
Loading…
Reference in New Issue
Block a user