From b731d1357d993663ee6b28d6627bdeba69b60dd2 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 11 Jul 2014 15:13:54 -0400 Subject: Fix locking bugs with XIAllowTouchEvents() and XIUngrabTouchBegin() Fix two places where the display was double locked when an API function chained to an implementation that also locks the display. Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/XIAllowEvents.c | 7 +------ src/XIPassiveGrab.c | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/XIAllowEvents.c b/src/XIAllowEvents.c index c8d997a..2468fce 100644 --- a/src/XIAllowEvents.c +++ b/src/XIAllowEvents.c @@ -86,17 +86,12 @@ Status XIAllowTouchEvents(Display *dpy, int deviceid, unsigned int touchid, Window grab_window, int event_mode) { - int status; XExtDisplayInfo *extinfo = XInput_find_display(dpy); LockDisplay(dpy); if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == -1) return (NoSuchExtension); - - status = _XIAllowEvents(dpy, deviceid, event_mode, CurrentTime, touchid, grab_window); - UnlockDisplay(dpy); - SyncHandle(); - return status; + return _XIAllowEvents(dpy, deviceid, event_mode, CurrentTime, touchid, grab_window); } diff --git a/src/XIPassiveGrab.c b/src/XIPassiveGrab.c index 88f1aff..c743516 100644 --- a/src/XIPassiveGrab.c +++ b/src/XIPassiveGrab.c @@ -249,6 +249,7 @@ XIUngrabTouchBegin(Display* display, int deviceid, Window grab_window, LockDisplay(display); if (_XiCheckExtInit(display, XInput_2_2, extinfo) == -1) return -1; + UnlockDisplay(display); return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeTouchBegin, 0, grab_window, num_modifiers, modifiers); -- cgit v1.2.3