1
0
Fork 0

backends/x11: Trap errors from XIAllowTouchEvents

And report them as debug messages instead of crashing. We don't want them
to be visible usually because failures are expected in the autodeny
code path.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2808,
        https://launchpad.net/bugs/2029413

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3253>
This commit is contained in:
Daniel van Vugt 2023-09-07 15:00:05 +08:00
parent 80e15775a5
commit c7815f33a2

View file

@ -711,6 +711,7 @@ meta_backend_x11_finish_touch_sequence (MetaBackend *backend,
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
int event_mode;
int err;
if (state == META_SEQUENCE_ACCEPTED)
event_mode = XIAcceptTouch;
@ -719,10 +720,17 @@ meta_backend_x11_finish_touch_sequence (MetaBackend *backend,
else
g_return_if_reached ();
mtk_x11_error_trap_push (priv->xdisplay);
XIAllowTouchEvents (priv->xdisplay,
META_VIRTUAL_CORE_POINTER_ID,
clutter_event_sequence_get_slot (sequence),
DefaultRootWindow (priv->xdisplay), event_mode);
err = mtk_x11_error_trap_pop_with_return (priv->xdisplay);
if (err)
{
g_debug ("XIAllowTouchEvents failed event_mode %d with error %d",
event_mode, err);
}
if (state == META_SEQUENCE_REJECTED)
{