[PATCH xinput 3/4] test-xi2: group event selection down

Peter Hutterer peter.hutterer at who-t.net
Tue Jul 2 17:09:54 PDT 2013


No real functional changes, just group the two selection requests together.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/test_xi2.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/test_xi2.c b/src/test_xi2.c
index b64368e..40cc76e 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -363,9 +363,6 @@ test_xi2(Display	*display,
     if (m->deviceid == XIAllDevices)
         XISetMask(m->mask, XI_HierarchyChanged);
     XISetMask(m->mask, XI_PropertyEvent);
-    XISelectEvents(display, win, m, 1);
-    XMapWindow(display, win);
-    XSync(display, False);
 
     m = &mask[1];
     m->deviceid = (deviceid == -1) ? XIAllMasterDevices : deviceid;
@@ -381,7 +378,11 @@ test_xi2(Display	*display,
     XISetMask(m->mask, XI_RawTouchUpdate);
     XISetMask(m->mask, XI_RawTouchEnd);
 #endif
-    XISelectEvents(display, DefaultRootWindow(display), m, 1);
+
+    XISelectEvents(display, win, &mask[0], 1);
+    XISelectEvents(display, DefaultRootWindow(display), &mask[1], 1);
+    XMapWindow(display, win);
+    XSync(display, False);
 
     free(mask[0].mask);
     free(mask[1].mask);
-- 
1.8.2.1



More information about the xorg-devel mailing list