summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-01-05 06:30:11 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2012-01-09 11:07:39 +1000
commit292082716ea50ce342b5a0749c1ba116c237e509 (patch)
treedd54ba484ae352f77760a571df030f9a639ac7ef
parent2e5ee5c5f7728e288a915ce61b57385f98439744 (diff)
xts5: fix XSetDeviceFocus-5
t003() selects for key events on the root window. t005() takes over and then complains when the focus correctly follows the pointer and an event is delivered to the root window. If you don't expect events on the root window, unselect them first. We could also XCloseDisplay() at the end of each test but who knows what that does to the other tests. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--xts5/XI/XSetDeviceFocus.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/xts5/XI/XSetDeviceFocus.m b/xts5/XI/XSetDeviceFocus.m
index be420907..0fafc4fa 100644
--- a/xts5/XI/XSetDeviceFocus.m
+++ b/xts5/XI/XSetDeviceFocus.m
@@ -430,6 +430,7 @@ XEvent ev;
int n, sav_revert;
int dkp, dkr;
XEventClass classes[2];
+XEventClass none_class;
if (noext(0))
return;
@@ -446,6 +447,9 @@ XEventClass classes[2];
DeviceKeyRelease(device, dkr, classes[1]);
win = defwin(display);
XSelectExtensionEvent(display, win, classes, 2);
+ /* previous test selected for events on the root window */
+ NoExtensionEvent(device, 0, none_class);
+ XSelectExtensionEvent(display, DRW(display), &none_class, 1);
focus = FollowKeyboard;
XCALL;