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 <[email protected]>
Reviewed-by: Chase Douglas <[email protected]>
---
Changes to v1:
- hah! there is a macro for the "no event" class after all. use that.

Chase, I figured your rev-by still stands given that this is the same effect
but much saner.

 xts5/XI/XSetDeviceFocus.m |    4 ++++
 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;
-- 
1.7.7.4
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to