all repos — openbox @ fdd1c3c8a7eac8ba1246ae64cbfca6f922294c51

openbox fork - make it a bit more like ryudo

add a 'Switch to...' entry to empty desktops in the client-list-menu
Dana Jansens danakj@orodu.net
commit

fdd1c3c8a7eac8ba1246ae64cbfca6f922294c51

parent

3b1e518dbc2bf468db93ba6ea923c71c74b4b3cb

1 files changed, 14 insertions(+), 1 deletions(-)

jump to
M openbox/client_list_menu.copenbox/client_list_menu.c

@@ -42,6 +42,7 @@ DesktopData *d = data;

GList *it; gint i; gboolean icons = FALSE; + gboolean empty = TRUE; menu_clear_entries(menu);

@@ -52,6 +53,8 @@ GSList *acts;

ObAction* act; ObMenuEntry *e; ObClientIcon *icon; + + empty = FALSE; if (!icons && c->iconic) { icons = TRUE;

@@ -72,7 +75,17 @@ e->data.normal.icon_data = icon->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