Change the client list menus back to separating iconified windows with a line instead...
authorMikael Magnusson <mikachu@comhem.se>
Mon, 23 Jul 2007 23:38:43 +0000 (01:38 +0200)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 26 Jul 2007 19:11:08 +0000 (21:11 +0200)
openbox/client_list_combined_menu.c
openbox/client_list_menu.c

index 556245df3981970e61471c1248478924d1680afa..77c250fe3cf4ae91a406df9de498e49ed2e72d9e 100644 (file)
@@ -48,6 +48,7 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
     for (desktop = 0; desktop < screen_num_desktops; desktop++) {
         gboolean empty = TRUE;
         gboolean onlyiconic = TRUE;
+        gboolean noicons = TRUE;
 
         menu_add_separator(menu, CLIENT, screen_desktop_names[desktop]);
         for (it = focus_order; it; it = g_list_next(it)) {
@@ -60,9 +61,11 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
                 empty = FALSE;
 
                 if (c->iconic) {
-                    gchar *title = g_strdup_printf("(%s)", c->icon_title);
-                    e = menu_add_normal(menu, CLIENT, title, NULL, FALSE);
-                    g_free(title);
+                    if (noicons) {
+                        menu_add_separator(menu, -1, NULL);
+                        noicons = FALSE;
+                    }
+                    e = menu_add_normal(menu, CLIENT, c->icon_title, NULL, FALSE);
                 } else {
                     onlyiconic = FALSE;
                     e = menu_add_normal(menu, CLIENT, c->title, NULL, FALSE);
index 25bb623054971d341b1bfc6b2145fc004b640978..f4511c7b1cfaece87f2a16a0416de4a31160e4c3 100644 (file)
@@ -48,6 +48,7 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data)
     GList *it;
     gboolean empty = TRUE;
     gboolean onlyiconic = TRUE;
+    gboolean noicons = TRUE;
 
     menu_clear_entries(menu);
 
@@ -62,9 +63,11 @@ static gboolean desk_menu_update(ObMenuFrame *frame, gpointer data)
             empty = FALSE;
 
             if (c->iconic) {
-                gchar *title = g_strdup_printf("(%s)", c->icon_title);
-                e = menu_add_normal(menu, CLIENT, title, NULL, FALSE);
-                g_free(title);
+                if (noicons) {
+                    menu_add_separator(menu, -1, NULL);
+                    noicons = FALSE;
+                }
+                e = menu_add_normal(menu, CLIENT, c->icon_title, NULL, FALSE);
             } else {
                 onlyiconic = FALSE;
                 e = menu_add_normal(menu, CLIENT, c->title, NULL, FALSE);