summaryrefslogtreecommitdiff
authorPeter Hutterer <peter.hutterer@who-t.net>2012-01-05 11:30:11 (GMT)
committer Peter Hutterer <peter.hutterer@who-t.net>2012-01-09 01:07:39 (GMT)
commit292082716ea50ce342b5a0749c1ba116c237e509 (patch) (side-by-side diff)
treedd54ba484ae352f77760a571df030f9a639ac7ef
parent2e5ee5c5f7728e288a915ce61b57385f98439744 (diff)
downloadxts-master.zip
xts-master.tar.gz
xts5: fix XSetDeviceFocus-5HEADmaster
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>
Diffstat (more/less context) (ignore whitespace changes)
-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 be42090..0fafc4f 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;