File U_Fix-logic-in-_XIAllowEvents-and-prevent-double-unlock.patch of Package libXi.3538

From: Michal Srb <msrb@suse.com>
Date: Sat Nov 1 20:00:56 2014 +0200
Subject: [PATCH]Fix logic in _XIAllowEvents and prevent double unlock.
Patch-mainline: Upstream
Git-commit: 5810d0797160a97012664ffe719a59e1b288a525
Git-repo: git://anongit.freedesktop.org/git/xorg/lib/libXi
References: bnc#940529
Signed-off-by: Egbert Eich <eich@suse.com>

Replacing the second _XiCheckExtInit with _XiCheckVersion prevents possible
double unlock as _XiCheckExtInit actually unlocks the display when it returns
-1.

Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 src/XIAllowEvents.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/XIAllowEvents.c b/src/XIAllowEvents.c
index 2468fce..52c17ab 100644
--- a/src/XIAllowEvents.c
+++ b/src/XIAllowEvents.c
@@ -40,7 +40,7 @@ static Status
 _XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time,
                     unsigned int touchid, Window grab_window)
 {
-    Bool have_XI22 = True;
+    Bool have_XI22 = False;
     xXIAllowEventsReq *req;
     xXI2_2AllowEventsReq *req_XI22;
 
@@ -50,7 +50,7 @@ _XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time,
     if (_XiCheckExtInit(dpy, XInput_2_0, extinfo) == -1)
 	return (NoSuchExtension);
 
-    if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == 0)
+    if (_XiCheckVersion(extinfo, XInput_2_2) == 0)
         have_XI22 = True;
 
     if (have_XI22)
openSUSE Build Service is sponsored by