Allow skip_taskbar windows to be focused on map when the user requests it in rc.xml...
authorDana Jansens <danakj@orodu.net>
Wed, 9 Dec 2009 15:56:43 +0000 (10:56 -0500)
committerDana Jansens <danakj@orodu.net>
Wed, 9 Dec 2009 15:56:43 +0000 (10:56 -0500)
openbox/client.c
openbox/focus.c
openbox/focus.h
openbox/focus_cycle.c
openbox/focus_cycle_popup.c

index a91b950..c457695 100644 (file)
@@ -370,7 +370,8 @@ void client_manage(Window window, ObPrompt *prompt)
         (user_time != 0) &&
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
         (user_time != 0) &&
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
-        focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))
+        focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE,
+                           settings->focus == 1))
     {
         activate = TRUE;
     }
     {
         activate = TRUE;
     }
index 8c3bd70..7eea6c3 100644 (file)
@@ -130,7 +130,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus,
            3. it is not shaded
         */
         if ((allow_omnipresent || c->desktop == screen_desktop) &&
            3. it is not shaded
         */
         if ((allow_omnipresent || c->desktop == screen_desktop) &&
-            focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE) &&
+            focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) &&
             !c->shaded &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
             !c->shaded &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
@@ -150,7 +150,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus,
            a splashscreen or a desktop window (save the desktop as a
            backup fallback though)
         */
            a splashscreen or a desktop window (save the desktop as a
            backup fallback though)
         */
-        if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE) &&
+        if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
         {
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
         {
@@ -281,7 +281,7 @@ static gboolean focus_target_has_siblings(ObClient *ft,
         /* check that it's not a helper window to avoid infinite recursion */
         if (c != ft && c->type == OB_CLIENT_TYPE_NORMAL &&
             focus_valid_target(c, TRUE, iconic_windows, all_desktops,
         /* check that it's not a helper window to avoid infinite recursion */
         if (c != ft && c->type == OB_CLIENT_TYPE_NORMAL &&
             focus_valid_target(c, TRUE, iconic_windows, all_desktops,
-                               FALSE, FALSE))
+                               FALSE, FALSE, FALSE))
         {
             return TRUE;
         }
         {
             return TRUE;
         }
@@ -294,7 +294,8 @@ gboolean focus_valid_target(ObClient *ft,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
-                            gboolean desktop_windows)
+                            gboolean desktop_windows,
+                            gboolean user_request)
 {
     gboolean ok = FALSE;
 
 {
     gboolean ok = FALSE;
 
@@ -333,9 +334,11 @@ gboolean focus_valid_target(ObClient *ft,
                !focus_target_has_siblings(ft, iconic_windows, all_desktops))));
 
     /* it's not set to skip the taskbar (but this only applies to normal typed
                !focus_target_has_siblings(ft, iconic_windows, all_desktops))));
 
     /* it's not set to skip the taskbar (but this only applies to normal typed
-       windows, and is overridden if the window is modal) */
+       windows, and is overridden if the window is modal or if the user asked
+       for this window to be focused) */
     ok = ok && (ft->type != OB_CLIENT_TYPE_NORMAL ||
                 ft->modal ||
     ok = ok && (ft->type != OB_CLIENT_TYPE_NORMAL ||
                 ft->modal ||
+                user_request ||
                 !ft->skip_taskbar);
 
     /* it's not going to just send focus off somewhere else (modal window),
                 !ft->skip_taskbar);
 
     /* it's not going to just send focus off somewhere else (modal window),
@@ -348,7 +351,8 @@ gboolean focus_valid_target(ObClient *ft,
                                                      iconic_windows,
                                                      all_desktops,
                                                      dock_windows,
                                                      iconic_windows,
                                                      all_desktops,
                                                      dock_windows,
-                                                     desktop_windows));
+                                                     desktop_windows,
+                                                     FALSE));
     }
 
     return ok;
     }
 
     return ok;
index b8f8999..19ab406 100644 (file)
@@ -69,6 +69,7 @@ gboolean focus_valid_target(struct _ObClient *ft,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
-                            gboolean desktop_windows);
+                            gboolean desktop_windows,
+                            gboolean user_request);
 
 #endif
 
 #endif
index e30672d..20a738f 100644 (file)
@@ -60,7 +60,8 @@ void focus_cycle_stop(ObClient *ifclient)
                            focus_cycle_iconic_windows,
                            focus_cycle_all_desktops,
                            focus_cycle_dock_windows,
                            focus_cycle_iconic_windows,
                            focus_cycle_all_desktops,
                            focus_cycle_dock_windows,
-                           focus_cycle_desktop_windows))
+                           focus_cycle_desktop_windows,
+                           FALSE))
     {
         focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE);
         focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
     {
         focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE);
         focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
@@ -122,7 +123,8 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
                                focus_cycle_iconic_windows,
                                focus_cycle_all_desktops,
                                focus_cycle_dock_windows,
                                focus_cycle_iconic_windows,
                                focus_cycle_all_desktops,
                                focus_cycle_dock_windows,
-                               focus_cycle_desktop_windows))
+                               focus_cycle_desktop_windows,
+                               FALSE))
         {
             if (interactive) {
                 if (ft != focus_cycle_target) { /* prevents flicker */
         {
             if (interactive) {
                 if (ft != focus_cycle_target) { /* prevents flicker */
@@ -189,7 +191,7 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
         if (cur == c)
             continue;
         if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows,
         if (cur == c)
             continue;
         if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows,
-                                desktop_windows))
+                                desktop_windows, FALSE))
             continue;
 
         /* find the centre coords of this window, from the
             continue;
 
         /* find the centre coords of this window, from the
@@ -297,7 +299,7 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows,
                                    focus_cycle_iconic_windows,
                                    focus_cycle_all_desktops,
                                    focus_cycle_dock_windows,
                                    focus_cycle_iconic_windows,
                                    focus_cycle_all_desktops,
                                    focus_cycle_dock_windows,
-                                   focus_cycle_desktop_windows))
+                                   focus_cycle_desktop_windows, FALSE))
                 ft = it->data;
     }
 
                 ft = it->data;
     }
 
index df3558d..53a7eb0 100644 (file)
@@ -185,7 +185,8 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
                                iconic_windows,
                                all_desktops,
                                dock_windows,
                                iconic_windows,
                                all_desktops,
                                dock_windows,
-                               desktop_windows))
+                               desktop_windows,
+                               FALSE))
         {
             gchar *text = popup_get_name(ft);
 
         {
             gchar *text = popup_get_name(ft);