]> Dogcows Code - chaz/openbox/blobdiff - tests/focusout.c
Merge branch 'master' into chaz
[chaz/openbox] / tests / focusout.c
index 1f31a8aa9084ea930a9a01c792c2226ee5659546..03ba56f619ffbd94e491864078d1d3f7fc6552fa 100644 (file)
@@ -44,10 +44,11 @@ int main () {
                         10, 10, w-20, h-20, 0, CopyFromParent, CopyFromParent,
                         CopyFromParent, 0, NULL);
 
-    XSetWindowBackground(display,win,WhitePixel(display,0)); 
-    XSetWindowBackground(display,child,BlackPixel(display,0)); 
+    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);
 
@@ -116,7 +117,8 @@ int main () {
             case NotifyVirtual: detail = "NotifyVirtual"; break;
             case NotifyInferior: detail = "NotifyInferior"; break;
             case NotifyNonlinear: detail = "NotifyNonlinear"; break;
-            case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
+            case NotifyNonlinearVirtual:
+                detail = "NotifyNonlinearVirtual"; break;
             case NotifyPointer: detail = "NotifyPointer"; break;
             case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
             case NotifyDetailNone: detail = "NotifyDetailNone"; break;
@@ -143,7 +145,8 @@ int main () {
             case NotifyVirtual: detail = "NotifyVirtual"; break;
             case NotifyInferior: detail = "NotifyInferior"; break;
             case NotifyNonlinear: detail = "NotifyNonlinear"; break;
-            case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
+            case NotifyNonlinearVirtual:
+                detail = "NotifyNonlinearVirtual"; break;
             case NotifyPointer: detail = "NotifyPointer"; break;
             case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
             case NotifyDetailNone: detail = "NotifyDetailNone"; break;
@@ -157,8 +160,64 @@ 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;
This page took 0.025285 seconds and 4 git commands to generate.