]> Dogcows Code - chaz/openbox/commitdiff
Make focus_valid_target() take a desktop argument.
authorDana Jansens <danakj@orodu.net>
Fri, 8 Jan 2010 19:40:29 +0000 (14:40 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 8 Jan 2010 19:44:37 +0000 (14:44 -0500)
So you can find valid targets on desktops other than the currently visible one

openbox/client.c
openbox/client_list_combined_menu.c
openbox/client_list_menu.c
openbox/focus.c
openbox/focus.h
openbox/focus_cycle.c
openbox/focus_cycle_popup.c

index 4d8f4e77ae014e374fc53c31ce3dadcb3bd55b46..98a27dc947bd78331328d2062decc86ae72cff94 100644 (file)
@@ -290,7 +290,8 @@ void client_manage(Window window, ObPrompt *prompt)
         (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, self->desktop,
+                           FALSE, FALSE, TRUE, FALSE, FALSE,
                            settings->focus == 1))
     {
         activate = TRUE;
index 7f0e9f5ddb3c8924a694bee4ac23ecdcf7321271..22840ad6ae9c5e53e61c6e0de1b4070879d5bac7 100644 (file)
@@ -53,7 +53,8 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
         menu_add_separator(menu, SEPARATOR, screen_desktop_names[desktop]);
         for (it = focus_order; it; it = g_list_next(it)) {
             ObClient *c = it->data;
-            if (focus_valid_target(c, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE))
+            if (focus_valid_target(c, desktop,
+                                   TRUE, TRUE, FALSE, FALSE, FALSE, FALSE))
             {
                 empty = FALSE;
 
index e1f4987a5910fe29dad0764e0da3ac02ca1610cd..3f79f621f10882017bcd92276e1b9e197bb273bd 100644 (file)
@@ -54,7 +54,8 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data)
 
     for (it = focus_order; it; it = g_list_next(it)) {
         ObClient *c = it->data;
-        if (focus_valid_target(c, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE)) {
+        if (focus_valid_target(c, d->desktop,
+                               TRUE, TRUE, FALSE, FALSE, FALSE, FALSE)) {
             ObMenuEntry *e;
 
             empty = FALSE;
index 7312974909d6ca2953d98ae0169c323122f79523..8b4b66e465853e47730a9978d543cc3bd800619f 100644 (file)
@@ -129,7 +129,8 @@ static ObClient* focus_fallback_target(gboolean allow_refocus,
            3. it is not shaded
         */
         if ((allow_omnipresent || c->desktop == screen_desktop) &&
-            focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) &&
+            focus_valid_target(c, screen_desktop,
+                               TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) &&
             !c->shaded &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
@@ -149,7 +150,8 @@ static ObClient* focus_fallback_target(gboolean allow_refocus,
            a splashscreen or a desktop window (save the desktop as a
            backup fallback though)
         */
-        if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) &&
+        if (focus_valid_target(c, screen_desktop,
+                               TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
         {
@@ -273,7 +275,8 @@ static gboolean focus_target_has_siblings(ObClient *ft,
         ObClient *c = it->data;
         /* 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,
+            focus_valid_target(c, screen_desktop,
+                               TRUE, iconic_windows, all_desktops,
                                FALSE, FALSE, FALSE))
         {
             return TRUE;
@@ -283,6 +286,7 @@ static gboolean focus_target_has_siblings(ObClient *ft,
 }
 
 gboolean focus_valid_target(ObClient *ft,
+                            guint    desktop,
                             gboolean helper_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
@@ -296,7 +300,7 @@ gboolean focus_valid_target(ObClient *ft,
 
        do this check first because it will usually filter out the most
        windows */
-    ok = (all_desktops || ft->desktop == screen_desktop ||
+    ok = (all_desktops || ft->desktop == desktop ||
           ft->desktop == DESKTOP_ALL);
 
     /* the window can receive focus somehow */
@@ -341,6 +345,7 @@ gboolean focus_valid_target(ObClient *ft,
     {
         ObClient *cft = client_focus_target(ft);
         ok = ok && (ft == cft || !focus_valid_target(cft,
+                                                     screen_desktop,
                                                      TRUE,
                                                      iconic_windows,
                                                      all_desktops,
index 80ce3a38728dcfd29586e190336da1690eeb52de..f926d01ee03a279678472efff8a8e1aedebd0282 100644 (file)
@@ -65,6 +65,7 @@ void focus_order_to_bottom(struct _ObClient *c);
 struct _ObClient *focus_order_find_first(guint desktop);
 
 gboolean focus_valid_target(struct _ObClient *ft,
+                            guint    desktop,
                             gboolean helper_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
index a70151fdce236ea31ae0e6798217f93b461bdf09..4e04477bcc79f8e71e4692fc00ec4c8ef2078080 100644 (file)
@@ -115,7 +115,7 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
             if (it == NULL) it = g_list_last(list);
         }
         ft = it->data;
-        if (focus_valid_target(ft, TRUE,
+        if (focus_valid_target(ft, screen_desktop, TRUE,
                                focus_cycle_iconic_windows,
                                focus_cycle_all_desktops,
                                focus_cycle_dock_windows,
@@ -186,7 +186,8 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
         /* the currently selected window isn't interesting */
         if (cur == c)
             continue;
-        if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows,
+        if (!focus_valid_target(it->data, screen_desktop,
+                                TRUE, FALSE, FALSE, dock_windows,
                                 desktop_windows, FALSE))
             continue;
 
@@ -291,7 +292,7 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows,
         GList *it;
 
         for (it = focus_order; it; it = g_list_next(it))
-            if (focus_valid_target(it->data, TRUE,
+            if (focus_valid_target(it->data, screen_desktop, TRUE,
                                    focus_cycle_iconic_windows,
                                    focus_cycle_all_desktops,
                                    focus_cycle_dock_windows,
index 4f697fdd335b1c397911209b73724107d78252cd..42484418870f379d273a6312a3361d1f20125cfb 100644 (file)
@@ -261,7 +261,7 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
     for (it = g_list_last(focus_order); it; it = g_list_previous(it)) {
         ObClient *ft = it->data;
 
-        if (focus_valid_target(ft, TRUE,
+        if (focus_valid_target(ft, screen_desktop, TRUE,
                                iconic_windows,
                                all_desktops,
                                dock_windows,
This page took 0.034351 seconds and 4 git commands to generate.