diff --git a/src/backends/native/meta-barrier-native.c b/src/backends/native/meta-barrier-native.c index 828cdad2f..610ebe9b3 100644 --- a/src/backends/native/meta-barrier-native.c +++ b/src/backends/native/meta-barrier-native.c @@ -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; diff --git a/src/backends/x11/meta-barrier-x11.c b/src/backends/x11/meta-barrier-x11.c index 174c65979..ea036ebf0 100644 --- a/src/backends/x11/meta-barrier-x11.c +++ b/src/backends/x11/meta-barrier-x11.c @@ -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);