]> Dogcows Code - chaz/openbox/commitdiff
watch for reverttoparent reverting to the root window, which will create a DetailInfe...
authorDana Jansens <danakj@orodu.net>
Sat, 24 Mar 2007 23:19:45 +0000 (23:19 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 24 Mar 2007 23:19:45 +0000 (23:19 +0000)
adding some debug messages also which I am using..

openbox/client.c
openbox/event.c
openbox/frame.c
openbox/frame.h

index f1be6fa4b2d2f2888e4519c80eeb150e1b16f7b6..a51ecfd7c7ed54ce2ba0e094d394b9969cb6f885 100644 (file)
@@ -220,13 +220,14 @@ void client_manage(Window window)
 
     grab_server(TRUE);
 
-    /* check if it has already been unmapped by the time we started mapping
+    /* check if it has already been unmapped by the time we started mapping.
        the grab does a sync so we don't have to here */
     if (XCheckTypedWindowEvent(ob_display, window, DestroyNotify, &e) ||
         XCheckTypedWindowEvent(ob_display, window, UnmapNotify, &e))
     {
         XPutBackEvent(ob_display, &e);
 
+        ob_debug("Trying to manage unmapped window. Aborting that.\n");
         grab_server(FALSE);
         return; /* don't manage it */
     }
@@ -393,6 +394,8 @@ void client_manage(Window window)
        won't be all wacko!!
        also, this moves the window to the position where it has been placed
     */
+    ob_debug("placing window 0x%x at %d, %d with size %d x %d\n",
+             self->window, newx, newy, self->area.width, self->area.height);
     client_apply_startup_state(self, newx, newy);
 
     keyboard_grab_for_client(self, TRUE);
index b57037829f35a88fdd76419b18c602c6aeda25a1..7e66cc28ed6318c550bad537d96665a8127e68a6 100644 (file)
@@ -329,7 +329,8 @@ static gboolean wanted_focusevent(XEvent *e)
 
         if (win == RootWindow(ob_display, ob_screen)) {
             /* This means focus reverted off of a client */
-            if (detail == NotifyPointerRoot || detail == NotifyDetailNone)
+            if (detail == NotifyPointerRoot || detail == NotifyDetailNone ||
+                detail == NotifyInferior)
                 return TRUE;
             else
                 return FALSE;
@@ -688,7 +689,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
         } else if (ce.xfocus.detail == NotifyInferior) {
             ob_debug("Focus went to parent\n");
             /* Focus has been reverted to parent, which is our frame window,
-               so fall back to something other than the window which had it. */
+               or the root window, so fall back to something other than the
+               window which had it. */
             focus_fallback(FALSE);
         } else {
             /* Focus did move, so process the FocusIn event */
@@ -906,7 +908,10 @@ static void event_handle_client(ObClient *client, XEvent *e)
         }
         break;
     case UnmapNotify:
-        ob_debug("UnmapNotify for window 0x%x\n", client->window);
+        ob_debug("UnmapNotify for window 0x%x eventwin 0x%x sendevent %d "
+                 "ignores left %d\n",
+                 client->window, e->xunmap.event, e->xunmap.from_configure,
+                 client->ignore_unmaps);
         if (client->ignore_unmaps) {
             client->ignore_unmaps--;
             break;
@@ -932,6 +937,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
            X server to deal with after we unmanage the window */
         XPutBackEvent(ob_display, e);
      
+        ob_debug("ReparentNotify for window 0x%x\n", client->window);
         client_unmanage(client);
         break;
     case MapRequest:
index 5383f7a379f5a7458de03628df8ae0023e311ce2..880ab1b552cc20952166a685ef491871b73e8825 100644 (file)
@@ -234,32 +234,26 @@ static void frame_free(ObFrame *self)
 
 void frame_show(ObFrame *self)
 {
+    ob_debug("frame_show for window 0x%x : %d\n", self->client->window,
+             self->visible);
     if (!self->visible) {
         self->visible = TRUE;
         XMapWindow(ob_display, self->client->window);
         XMapWindow(ob_display, self->window);
-        self->firstmap = TRUE;
     }
 }
 
 void frame_hide(ObFrame *self)
 {
-    if (self->visible || self->firstmap == FALSE) {
-        if (self->visible) {
-            self->visible = FALSE;
-            self->client->ignore_unmaps += 1;
-            /* we unmap the client itself so that we can get MapRequest
-               events, and because the ICCCM tells us to! */
-            XUnmapWindow(ob_display, self->window);
-            XUnmapWindow(ob_display, self->client->window);
-        } else {
-            /* the frame wasn't visible, but the frame is being hidden now.
-               so we don't need to unmap the frame, but we do need to unmap
-               the client. */
-            self->client->ignore_unmaps += 1;
-            XUnmapWindow(ob_display, self->client->window);
-        }
-        self->firstmap = TRUE;
+    ob_debug("frame_hide for window 0x%x : %d\n", self->client->window,
+             self->visible);
+    if (self->visible) {
+        self->visible = FALSE;
+        self->client->ignore_unmaps += 1;
+        /* we unmap the client itself so that we can get MapRequest
+           events, and because the ICCCM tells us to! */
+        XUnmapWindow(ob_display, self->window);
+        XUnmapWindow(ob_display, self->client->window);
     }
 }
 
index 70855b1b8156e79d4c8f5dd6cc856ece627b07aa..0d04436630fa467c3f0d656c270d96dd43b371c7 100644 (file)
@@ -76,7 +76,6 @@ struct _ObFrame
     Strut     size;
     Rect      area;
     gboolean  visible;
-    gboolean  firstmap;
 
     /*! Whether the window is obscured at all or fully visible. */
     gboolean obscured;
This page took 0.035211 seconds and 4 git commands to generate.