]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
add window placement routines to the kernel
[chaz/openbox] / openbox / focus.c
index a04e4d401e64a4e6e12c1f6db7cb282447467fc8..283294296b444c2c4a7394a407c97b5b40710f06 100644 (file)
@@ -1,3 +1,4 @@
+#include "debug.h"
 #include "event.h"
 #include "openbox.h"
 #include "grab.h"
 #include <assert.h>
 
 ObClient *focus_client;
-GList **focus_order = NULL; /* these lists are created when screen_startup
-                               sets the number of desktops */
+GList **focus_order; /* these lists are created when screen_startup
+                        sets the number of desktops */
 
-static ObClient *focus_cycle_target = NULL;
-static Popup *focus_cycle_popup = NULL;
+static ObClient *focus_cycle_target;
+static Popup *focus_cycle_popup;
 
 void focus_startup()
 {
@@ -64,7 +65,7 @@ void focus_set_client(ObClient *client)
     ObClient *old;
 
 #ifdef DEBUG_FOCUS
-    g_message("focus_set_client 0x%lx", client ? client->window : 0);
+    ob_debug("focus_set_client 0x%lx\n", client ? client->window : 0);
 #endif
 
     /* uninstall the old colormap, and install the new one */
@@ -189,6 +190,7 @@ void focus_fallback(ObFocusFallbackType type)
             }
         }
 
+#if 0
         /* try for group relations */
         if (old->group) {
             GSList *sit;
@@ -203,6 +205,7 @@ void focus_fallback(ObFocusFallbackType type)
                                 return;
                             }
         }
+#endif
     }
 
     for (it = focus_order[screen_desktop]; it != NULL; it = it->next)
@@ -239,7 +242,7 @@ static void popup_cycle(ObClient *c, gboolean show)
 */
         /* XXX the size and the font extents need to be related on some level
          */
-        popup_size(focus_cycle_popup, 320, 48);
+        popup_size(focus_cycle_popup, POPUP_WIDTH, POPUP_HEIGHT);
 
         /* use the transient's parent's title/icon */
         while (p->transient_for && p->transient_for != OB_TRAN_GROUP)
@@ -261,7 +264,7 @@ static void popup_cycle(ObClient *c, gboolean show)
 }
 
 ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
-                    gboolean cancel)
+                      gboolean cancel)
 {
     static ObClient *first = NULL;
     static ObClient *t = NULL;
@@ -277,11 +280,9 @@ ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
         goto done_cycle;
     } else if (done) {
         if (focus_cycle_target)
-            client_activate(focus_cycle_target);
+            client_activate(focus_cycle_target, FALSE);
         goto done_cycle;
     }
-    if (!first)
-        grab_pointer(TRUE, None);
 
     if (!first) first = focus_client;
     if (!focus_cycle_target) focus_cycle_target = focus_client;
@@ -310,6 +311,7 @@ ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
            desktop */
         if (ft->transients == NULL && client_normal(ft) &&
             ((ft->can_focus || ft->focus_notify) &&
+             !ft->skip_taskbar &&
              (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL))) {
             if (ft != focus_cycle_target) { /* prevents flicker */
                 if (focus_cycle_target)
@@ -330,7 +332,6 @@ done_cycle:
     order = NULL;
 
     popup_cycle(ft, FALSE);
-    grab_pointer(FALSE, None);
 
     return NULL;
 }
This page took 0.025742 seconds and 4 git commands to generate.