Merge branches 'wip/edges', 'mikabox/crap', 'mikabox/lock', 'mikabox/maybe' and ...
[mikachu/openbox.git] / openbox / client_list_menu.c
index f3df2a5..b88673d 100644 (file)
@@ -49,6 +49,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);
 
@@ -61,9 +62,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, d->desktop, title, NULL, FALSE);
-                g_free(title);
+                if (noicons) {
+                    menu_add_separator(menu, -1, NULL);
+                    noicons = FALSE;
+                }
+                e = menu_add_normal(menu, d->desktop, c->icon_title, NULL, FALSE);
             } else {
                 onlyiconic = FALSE;
                 e = menu_add_normal(menu, d->desktop, c->title, NULL, FALSE);
@@ -99,7 +102,7 @@ static void desk_menu_execute(ObMenuEntry *self, ObMenuFrame *f,
                               ObClient *c, guint state, gpointer data)
 {
     ObClient *t = self->data.normal.data;
-    if (t) { /* it's set to NULL if its destroyed */
+    if (t && !t->locked) { /* it's set to NULL if its destroyed */
         gboolean here = state & ShiftMask;
 
         client_activate(t, TRUE, here, TRUE, TRUE, TRUE);