]> Dogcows Code - chaz/openbox/commitdiff
merge r6176-6182 from 3.4-working
authorDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 21:57:36 +0000 (21:57 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 21:57:36 +0000 (21:57 +0000)
openbox/client.c
openbox/client.h
openbox/event.c
openbox/focus.c
openbox/modkeys.c

index c872bbc9224fb1736b74fc085518802def35a284..e0d5c215a9afd6b00797b8dce3f15672fe827fb1 100644 (file)
@@ -2994,8 +2994,7 @@ void client_hilite(ObClient *self, gboolean hilite)
 
 void client_set_desktop_recursive(ObClient *self,
                                   guint target,
-                                  gboolean donthide,
-                                  gboolean focus_nonintrusive)
+                                  gboolean donthide)
 {
     guint old;
     GSList *it;
@@ -3006,10 +3005,6 @@ void client_set_desktop_recursive(ObClient *self,
 
         g_assert(target < screen_num_desktops || target == DESKTOP_ALL);
 
-        /* remove from the old desktop(s) */
-        if (!focus_nonintrusive)
-            focus_order_remove(self);
-
         old = self->desktop;
         self->desktop = target;
         PROP_SET32(self->window, net_wm_desktop, cardinal, target);
@@ -3024,14 +3019,6 @@ void client_set_desktop_recursive(ObClient *self,
         if (STRUT_EXISTS(self->strut))
             screen_update_areas();
 
-        /* add to the new desktop(s) */
-        if (!focus_nonintrusive) {
-            if (config_focus_new)
-                focus_order_to_top(self);
-            else
-                focus_order_to_bottom(self);
-        }
-
         /* call the notifies */
         GSList *it;
         for (it = client_desktop_notifies; it; it = g_slist_next(it)) {
@@ -3049,7 +3036,7 @@ void client_set_desktop_recursive(ObClient *self,
 }
 
 void client_set_desktop(ObClient *self, guint target,
-                        gboolean donthide, gboolean focus_nonintrusive)
+                        gboolean donthide)
 {
     self = client_search_top_normal_parent(self);
     client_set_desktop_recursive(self, target, donthide, focus_nonintrusive);
@@ -3460,7 +3447,8 @@ static void client_bring_helper_windows_recursive(ObClient *self,
     if (client_helper(self) &&
         self->desktop != desktop && self->desktop != DESKTOP_ALL)
     {
-        client_set_desktop(self, desktop, FALSE, TRUE);
+        client_set_desktop(self, desktop, FALSE);
+>>>>>>> .merge-right.r6182
     }
 }
 
@@ -3902,17 +3890,3 @@ gboolean client_has_group_siblings(ObClient *self)
 {
     return self->group && self->group->members->next;
 }
-
-gboolean client_has_non_helper_group_siblings(ObClient *self)
-{
-    GSList *it;
-
-    if (!self->group) return FALSE;
-
-    for (it = self->group->members; it; it = g_slist_next(it)) {
-        ObClient *c = it->data;
-        if (c != self && client_normal(c) && !client_helper(c))
-            return TRUE;
-    }
-    return FALSE;
-}
index ae60181c8b3f6113e6a2a453bc2dfef9b394f774..5fb26262a9f2b8e29b5b17ada0b4f21c22acfbc1 100644 (file)
@@ -464,13 +464,9 @@ void client_kill(ObClient *self);
 
 /*! Sends the window to the specified desktop
   @param donthide If TRUE, the window will not be shown/hidden after its
-         desktop has been changed. Generally this should be FALSE.
-  @param focus_nonintrusive If TRUE, the window will not be moved in the
-         focus order at all. Do this when moving windows to a desktop in
-         the "background" or something. It can be used to make a window share
-         multiple desktops. Generally this should be FALSE. */
-void client_set_desktop(ObClient *self, guint target,
-                        gboolean donthide, gboolean focus_nonintrusive);
+                  desktop has been changed. Generally this should be FALSE.
+*/
+void client_set_desktop(ObClient *self, guint target, gboolean donthide);
 
 /*! Show the client if it should be shown. */
 void client_show(ObClient *self);
@@ -665,8 +661,4 @@ ObClient* client_under_pointer();
 
 gboolean client_has_group_siblings(ObClient *self);
 
-/*! Returns if a client has an group siblings which are main application
-  windows (not helper or non-normal windows) */
-gboolean client_has_non_helper_group_siblings(ObClient *self);
-
 #endif
index ace3e86177821978ed41e606cf87c955992855e8..38ad837c7afef47e3a60398270afc965158eaf68 100644 (file)
@@ -43,7 +43,6 @@
 #include "translate.h"
 
 #include <X11/Xlib.h>
-#include <X11/keysym.h>
 #include <X11/Xatom.h>
 #include <glib.h>
 
index b473686aea5a49b970e76dc303436c0502a41cd5..80cd0b080affecc29f00e8b10272ddcfe0040a9e 100644 (file)
@@ -37,7 +37,7 @@
 #include <glib.h>
 #include <assert.h>
 
-#define FOCUS_INDICATOR_WIDTH 5
+#define FOCUS_INDICATOR_WIDTH 6
 
 ObClient *focus_client = NULL;
 GList *focus_order = NULL;
@@ -528,6 +528,28 @@ void focus_cycle_draw_indicator()
     }
 }
 
+static gboolean has_valid_group_siblings_on_desktop(ObClient *ft,
+                                                    gboolean all_desktops)
+                                                         
+{
+    GSList *it;
+
+    if (!ft->group) return FALSE;
+
+    for (it = ft->group->members; it; it = g_slist_next(it)) {
+        ObClient *c = it->data;
+        /* check that it's not a helper window to avoid infinite recursion */
+        if (c != ft && !client_helper(ft) &&
+            valid_focus_target(ft, all_desktops, FALSE))
+        {
+            return TRUE;
+        }
+    }
+    return FALSE;
+}
+
+/*! @param allow_helpers This is used for calling itself recursively while
+                         checking helper windows. */
 static gboolean valid_focus_target(ObClient *ft,
                                    gboolean all_desktops,
                                    gboolean dock_windows)
@@ -548,16 +570,17 @@ static gboolean valid_focus_target(ObClient *ft,
     if (dock_windows)
         ok = ok && ft->type == OB_CLIENT_TYPE_DOCK;
     else
-        ok = ok && (ft->type == OB_CLIENT_TYPE_NORMAL ||
-                    ft->type == OB_CLIENT_TYPE_DIALOG ||
-                    ((ft->type == OB_CLIENT_TYPE_TOOLBAR ||
-                      ft->type == OB_CLIENT_TYPE_MENU ||
-                      ft->type == OB_CLIENT_TYPE_UTILITY) &&
-                     /* let alt-tab go to these windows when a window in its
-                        group already has focus ... */
-                     ((focus_client && ft->group == focus_client->group) ||
-                      /* ... or if there are no main windows in its group */
-                      !client_has_non_helper_group_siblings(ft))));
+        /* normal non-helper windows are valid targets */
+        ok = ok &&
+            ((client_normal(ft) && !client_helper(ft))
+             ||
+             /* helper windows are valid targets it... */
+             (client_helper(ft) &&
+              /* ...a window in its group already has focus ... */
+              ((focus_client && ft->group == focus_client->group) ||
+               /* ... or if there are no other windows in its group 
+                  that can be cycled to instead */
+               !has_valid_group_siblings_on_desktop(ft, all_desktops))));
 
     /* it's not set to skip the taskbar (unless it is a type that would be
        expected to set this hint */
index dc5220825cc613eb5ab099580b1c8dab570aa28d..4eb836e5114548527f2c7bb3a4c71a88ef1031cd 100644 (file)
@@ -20,6 +20,7 @@
 #include "openbox.h"
 
 #include <X11/Xlib.h>
+#include <X11/keysym.h>
 
 /* These masks are constants and the modifier keys are bound to them as
    anyone sees fit:
This page took 0.035495 seconds and 4 git commands to generate.