]> Dogcows Code - chaz/openbox/blobdiff - openbox/focus.c
dont use the parent's title in the focus cycling dialog
[chaz/openbox] / openbox / focus.c
index ff1386bce332da334451e96d641887c2dc9fc33f..5560c3d43c1af21b7d9eb4cbb762a97506f271d1 100644 (file)
@@ -333,7 +333,7 @@ static void popup_cycle(ObClient *c, gboolean show)
     } else {
         Rect *a;
         ObClient *p = c;
-        gchar *title;
+        gchar *title = NULL;
 
         a = screen_physical_area_monitor(0);
         icon_popup_position(focus_cycle_popup, CenterGravity,
@@ -350,13 +350,13 @@ static void popup_cycle(ObClient *c, gboolean show)
         while (p->transient_for && p->transient_for != OB_TRAN_GROUP)
             p = p->transient_for;
 
-        if (p == c)
-            title = NULL;
-        else
+/*
+        if (p != c)
             title = g_strconcat((c->iconic ? c->icon_title : c->title),
                                 " - ",
                                 (p->iconic ? p->icon_title : p->title),
                                 NULL);
+*/
 
         icon_popup_show(focus_cycle_popup,
                         (title ? title :
@@ -513,7 +513,10 @@ static gboolean valid_focus_target(ObClient *ft)
            ft->type == OB_CLIENT_TYPE_UTILITY))) &&
         ((ft->can_focus || ft->focus_notify) &&
          !ft->skip_taskbar &&
-         (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL)))
+         (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL)) &&
+        ft == client_focus_target(ft))
+        return TRUE;
+/*
     {
         GSList *it;
 
@@ -525,6 +528,7 @@ static gboolean valid_focus_target(ObClient *ft)
         }
         return TRUE;
     }
+*/
 
     return FALSE;
 }
@@ -657,16 +661,19 @@ void focus_order_add_new(ObClient *c)
         d = c->desktop;
         if (d == DESKTOP_ALL) {
             for (i = 0; i < screen_num_desktops; ++i) {
+                g_assert(!g_list_find(focus_order[i], c));
                 if (focus_order[i] && ((ObClient*)focus_order[i]->data)->iconic)
                     focus_order[i] = g_list_insert(focus_order[i], c, 0);
                 else
                     focus_order[i] = g_list_insert(focus_order[i], c, 1);
             }
-        } else
-             if (focus_order[d] && ((ObClient*)focus_order[d]->data)->iconic)
+        } else {
+            g_assert(!g_list_find(focus_order[d], c));
+            if (focus_order[d] && ((ObClient*)focus_order[d]->data)->iconic)
                 focus_order[d] = g_list_insert(focus_order[d], c, 0);
             else
                 focus_order[d] = g_list_insert(focus_order[d], c, 1);
+        }
     }
 }
 
This page took 0.025003 seconds and 4 git commands to generate.