From b79a3919029d27287ab0c19f6facd12a7c1a4ae1 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 4 Oct 2012 14:47:31 +0000 Subject: [PATCH] Put an error trap around XIAllowTouchEvents() These calls are occasionally failing with BadAccess on seemingly still valid (not yet notified upon) touch sequences. Workaround this Xorg bug with error traps at the moment, those would catch no error when this is working properly. Fixing this bug will be tracked at SL #3981 Signed-off-by: Carlos Garnacho Acked-by: Simon Schampijer --- src/sugar3/sugar-gesture-grabber.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sugar3/sugar-gesture-grabber.c b/src/sugar3/sugar-gesture-grabber.c index 022ee5bc..b1d28db8 100644 --- a/src/sugar3/sugar-gesture-grabber.c +++ b/src/sugar3/sugar-gesture-grabber.c @@ -76,13 +76,15 @@ _sugar_gesture_grabber_notify_touch (SugarGestureGrabber *grabber, if (data->consumed) continue; + gdk_error_trap_push (); XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display), gdk_x11_device_get_id (data->device), GPOINTER_TO_INT (data->sequence), gdk_x11_window_get_xid (priv->root_window), (handled) ? XIAcceptTouch : XIRejectTouch); - data->consumed = TRUE; + gdk_error_trap_pop_ignored (); + data->consumed = TRUE; } } @@ -307,10 +309,12 @@ filter_function (GdkXEvent *xevent, handled = _sugar_gesture_grabber_run_controllers (grabber, event); if (!handled) { + gdk_error_trap_push (); XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display), ev->deviceid, ev->detail, gdk_x11_window_get_xid (priv->root_window), XIRejectTouch); + gdk_error_trap_pop_ignored (); } else if (event->type == GDK_TOUCH_BEGIN) { _sugar_gesture_grabber_add_touch (grabber, event->touch.device,