diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-18 06:17:51 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-18 06:17:51 +0000 |
| commit | fdd1c3c8a7eac8ba1246ae64cbfca6f922294c51 (patch) | |
| tree | 28e4af00cc742af89b6ddddfd7fe29394ce78b01 /openbox/client_list_menu.c | |
| parent | 3b1e518dbc2bf468db93ba6ea923c71c74b4b3cb (diff) | |
add a 'Switch to...' entry to empty desktops in the client-list-menu
Diffstat (limited to 'openbox/client_list_menu.c')
| -rw-r--r-- | openbox/client_list_menu.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 4011c429..acf9f071 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -42,6 +42,7 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data) GList *it; gint i; gboolean icons = FALSE; + gboolean empty = TRUE; menu_clear_entries(menu); @@ -53,6 +54,8 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data) ObMenuEntry *e; ObClientIcon *icon; + empty = FALSE; + if (!icons && c->iconic) { icons = TRUE; menu_add_separator(menu, -1); @@ -72,7 +75,17 @@ static void desk_menu_update(ObMenuFrame *frame, gpointer data) } } } - + + if (empty) { + /* no entries */ + + GSList *acts; + ObAction* act; + act = action_from_string("Desktop", OB_USER_ACTION_MENU_SELECTION); + act->data.desktop.desk = d->desktop; + acts = g_slist_prepend(NULL, act); + menu_add_normal(menu, 0, "Switch to...", acts); + } } /* executes it using the client in the actions, since we set that |
