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 <carlos@lanedo.com> Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
parent
81ee0632c9
commit
b79a391902
@ -76,13 +76,15 @@ _sugar_gesture_grabber_notify_touch (SugarGestureGrabber *grabber,
|
|||||||
if (data->consumed)
|
if (data->consumed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
gdk_error_trap_push ();
|
||||||
XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display),
|
XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display),
|
||||||
gdk_x11_device_get_id (data->device),
|
gdk_x11_device_get_id (data->device),
|
||||||
GPOINTER_TO_INT (data->sequence),
|
GPOINTER_TO_INT (data->sequence),
|
||||||
gdk_x11_window_get_xid (priv->root_window),
|
gdk_x11_window_get_xid (priv->root_window),
|
||||||
(handled) ? XIAcceptTouch : XIRejectTouch);
|
(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);
|
handled = _sugar_gesture_grabber_run_controllers (grabber, event);
|
||||||
|
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
|
gdk_error_trap_push ();
|
||||||
XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display),
|
XIAllowTouchEvents (gdk_x11_display_get_xdisplay (display),
|
||||||
ev->deviceid, ev->detail,
|
ev->deviceid, ev->detail,
|
||||||
gdk_x11_window_get_xid (priv->root_window),
|
gdk_x11_window_get_xid (priv->root_window),
|
||||||
XIRejectTouch);
|
XIRejectTouch);
|
||||||
|
gdk_error_trap_pop_ignored ();
|
||||||
} else if (event->type == GDK_TOUCH_BEGIN) {
|
} else if (event->type == GDK_TOUCH_BEGIN) {
|
||||||
_sugar_gesture_grabber_add_touch (grabber,
|
_sugar_gesture_grabber_add_touch (grabber,
|
||||||
event->touch.device,
|
event->touch.device,
|
||||||
|
Loading…
Reference in New Issue
Block a user