merge r7679,7680 from trunk
authorMikael Magnusson <mikachu@comhem.se>
Tue, 10 Jul 2007 23:45:37 +0000 (23:45 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Tue, 10 Jul 2007 23:45:37 +0000 (23:45 +0000)
openbox/client.c
openbox/focus.c
openbox/focus.h
openbox/focus_cycle.c
openbox/focus_cycle_popup.c
openbox/frame.c

index 36a827ac9228876dcac74a57cf36ec3c66d401f5..cb70419f37bc1b8d7d4b8522a92cd0fe4f052423 100644 (file)
@@ -273,6 +273,9 @@ void client_manage(Window window)
     /* get all the stuff off the window */
     client_get_all(self, TRUE);
 
+    ob_debug("Window type: %d\n", self->type);
+    ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0);
+
     /* specify that if we exit, the window should not be destroyed and
        should be reparented back to root automatically */
     XChangeSaveSet(ob_display, window, SetModeInsert);
@@ -319,7 +322,7 @@ void client_manage(Window window)
          client_search_focus_tree_full(self)) &&
         /* this checks for focus=false for the window */
         (!settings || settings->focus != 0) &&
-        focus_valid_target(self, FALSE, TRUE, FALSE, FALSE))
+        focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))
     {
         activate = TRUE;
     }
index f34021a47b5f4528b497d05e8e849a1924386913..0609877194c4bfe3758f3a80fa27f50559af6bd9 100644 (file)
@@ -127,7 +127,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus,
            backup fallback though)
         */
         if ((allow_omnipresent || c->desktop == screen_desktop) &&
-            focus_valid_target(c, FALSE, FALSE, FALSE, FALSE) &&
+            focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE) &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
         {
@@ -146,7 +146,7 @@ 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, FALSE, FALSE, FALSE, TRUE) &&
+        if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE) &&
             (allow_refocus || client_focus_target(c) != old) &&
             client_focus(c))
         {
@@ -284,7 +284,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, iconic_windows, all_desktops, FALSE, FALSE))
+            focus_valid_target(c, TRUE, iconic_windows, all_desktops,
+                               FALSE, FALSE))
         {
             return TRUE;
         }
@@ -293,6 +294,7 @@ static gboolean focus_target_has_siblings(ObClient *ft,
 }
 
 gboolean focus_valid_target(ObClient *ft,
+                            gboolean helper_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
@@ -326,10 +328,12 @@ gboolean focus_valid_target(ObClient *ft,
              ||
              /* helper windows are valid targets if... */
              (client_helper(ft) &&
-              /* ...a window in its group already has focus ... */
-              ((focus_client && ft->group == focus_client->group) ||
+              /* ...a window in its group already has focus and we want to
+                 include helper windows ... */
+              ((focus_client && ft->group == focus_client->group &&
+                helper_windows) ||
                /* ... or if there are no other windows in its group 
-                  that can be cycled to instead */
+                  that can be focused instead */
                !focus_target_has_siblings(ft, iconic_windows, all_desktops))));
 
     /* it's not set to skip the taskbar (unless it is a type that would be
@@ -348,6 +352,7 @@ gboolean focus_valid_target(ObClient *ft,
     {
         ObClient *cft = client_focus_target(ft);
         ok = ok && (ft == cft || !focus_valid_target(cft,
+                                                     TRUE,
                                                      iconic_windows,
                                                      all_desktops,
                                                      dock_windows,
index f5033aee455ab429e60c5cab9ab17a8299dfb538..93fe6183171e161860545f89c47b1a80bd24d3c0 100644 (file)
@@ -64,6 +64,7 @@ void focus_order_to_bottom(struct _ObClient *c);
 struct _ObClient *focus_order_find_first(guint desktop);
 
 gboolean focus_valid_target(struct _ObClient *ft,
+                            gboolean helper_windows,
                             gboolean iconic_windows,
                             gboolean all_desktops,
                             gboolean dock_windows,
index a5ac4e68ce4d84f55c35cb8512fc863aca9fc677..4e77452e6dc598a4682f3ce2460fe96c17ac2075 100644 (file)
@@ -56,7 +56,7 @@ void focus_cycle_stop(ObClient *ifclient)
     /* stop focus cycling if the given client is a valid focus target,
        and so the cycling is being disrupted */
     if (focus_cycle_target && ifclient &&
-        focus_valid_target(ifclient,
+        focus_valid_target(ifclient, TRUE,
                            focus_cycle_iconic_windows,
                            focus_cycle_all_desktops,
                            focus_cycle_dock_windows,
@@ -118,7 +118,7 @@ void focus_cycle(gboolean forward, gboolean all_desktops,
             if (it == NULL) it = g_list_last(list);
         }
         ft = it->data;
-        if (focus_valid_target(ft,
+        if (focus_valid_target(ft, TRUE,
                                focus_cycle_iconic_windows,
                                focus_cycle_all_desktops,
                                focus_cycle_dock_windows,
@@ -190,7 +190,7 @@ 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, FALSE, FALSE, dock_windows,
+        if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows,
                                 desktop_windows))
             continue;
 
@@ -292,7 +292,7 @@ void 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,
+            if (focus_valid_target(it->data, TRUE,
                                    focus_cycle_iconic_windows,
                                    focus_cycle_all_desktops,
                                    focus_cycle_dock_windows,
index 477619f557c37afc448cc2abba1961cbb2d9672a..e0a8080f7ed16c2d9b118eb0822f816bb2f416b2 100644 (file)
@@ -174,7 +174,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,
+        if (focus_valid_target(ft, TRUE,
                                iconic_windows,
                                all_desktops,
                                dock_windows,
index 096b783943167ec33f096f25b70ddd58f66ad9ed..144f8649f025b9ee5c4d879b24c79d135f8e91fc 100644 (file)
@@ -1676,7 +1676,10 @@ void frame_end_iconify_animation(ObFrame *self)
         XUnmapWindow(ob_display, self->window);
     else {
         /* Send a ConfigureNotify when the animation is done, this fixes
-           KDE's pager showing the window in the wrong place. */
+           KDE's pager showing the window in the wrong place.  since the
+           window is mapped at a different location and is then moved, we
+           need to send the synthetic configurenotify, since apps may have
+           read the position when the client mapped, apparently. */
         client_reconfigure(self->client, TRUE);
     }