diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-05-26 22:13:34 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-05-26 22:13:34 +0000 |
| commit | 5e9e266722826fbd5907df1bf900864ab23f6539 (patch) | |
| tree | 8750a5187dd73edaa93433be6d8d5c459abd6aaa /tests | |
| parent | 4a45cabd4fb99ac787a3f84f89541e1c76e578b4 (diff) | |
change in how things are ungrabbed to avoid grabwhilenotify. don't ungrab every key press. just ungrab the passive grab when there is no active grab and we are going to move focus.
this should be less intrusive and seems to work
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/focusout.c | 59 |
1 files changed, 57 insertions, 2 deletions
diff --git a/tests/focusout.c b/tests/focusout.c index 1f31a8aa..1cc7259d 100644 --- a/tests/focusout.c +++ b/tests/focusout.c @@ -47,7 +47,8 @@ int main () { XSetWindowBackground(display,win,WhitePixel(display,0)); XSetWindowBackground(display,child,BlackPixel(display,0)); - XSelectInput(display, win, FocusChangeMask); + XSelectInput(display, win, + FocusChangeMask|EnterWindowMask|LeaveWindowMask); XMapWindow(display, win); XMapWindow(display, child); @@ -157,8 +158,62 @@ int main () { printf("mode : %s\n", mode); printf("detail : %s\n", detail); printf("---\n"); - } + break; + case EnterNotify: + switch (report.xcrossing.mode) { + case NotifyNormal: mode = "NotifyNormal"; break; + case NotifyGrab: mode = "NotifyGrab"; break; + case NotifyUngrab: mode = "NotifyUngrab"; break; + } + + switch (report.xcrossing.detail) { + case NotifyAncestor: detail = "NotifyAncestor"; break; + case NotifyVirtual: detail = "NotifyVirtual"; break; + case NotifyInferior: detail = "NotifyInferior"; break; + case NotifyNonlinear: detail = "NotifyNonlinear"; break; + case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break; + case NotifyPointer: detail = "NotifyPointer"; break; + case NotifyPointerRoot: detail = "NotifyPointerRoot"; break; + case NotifyDetailNone: detail = "NotifyDetailNone"; break; + } + printf("enternotify\n"); + printf("type : %d\n", report.xcrossing.type); + printf("serial : %d\n", report.xcrossing.serial); + printf("send_event: %d\n", report.xcrossing.send_event); + printf("display : 0x%x\n", report.xcrossing.display); + printf("window : 0x%x\n", report.xcrossing.window); + printf("mode : %s\n", mode); + printf("detail : %s\n", detail); + printf("---\n"); + break; + case LeaveNotify: + switch (report.xcrossing.mode) { + case NotifyNormal: mode = "NotifyNormal"; break; + case NotifyGrab: mode = "NotifyGrab"; break; + case NotifyUngrab: mode = "NotifyUngrab"; break; + } + switch (report.xcrossing.detail) { + case NotifyAncestor: detail = "NotifyAncestor"; break; + case NotifyVirtual: detail = "NotifyVirtual"; break; + case NotifyInferior: detail = "NotifyInferior"; break; + case NotifyNonlinear: detail = "NotifyNonlinear"; break; + case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break; + case NotifyPointer: detail = "NotifyPointer"; break; + case NotifyPointerRoot: detail = "NotifyPointerRoot"; break; + case NotifyDetailNone: detail = "NotifyDetailNone"; break; + } + printf("leavenotify\n"); + printf("type : %d\n", report.xcrossing.type); + printf("serial : %d\n", report.xcrossing.serial); + printf("send_event: %d\n", report.xcrossing.send_event); + printf("display : 0x%x\n", report.xcrossing.display); + printf("window : 0x%x\n", report.xcrossing.window); + printf("mode : %s\n", mode); + printf("detail : %s\n", detail); + printf("---\n"); + break; + } } return 1; |
