From: Mikael Magnusson Date: Sun, 3 Feb 2008 15:53:33 +0000 (+0100) Subject: Add the manageDesktops option. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=12ca673de556b341588a7f67fb2b9417c1e91d6b;p=chaz%2Fopenbox Add the manageDesktops option. --- diff --git a/data/rc.xml b/data/rc.xml index d164660d..90ec90d1 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -622,9 +622,17 @@ menu.xml 200 + no + 100 + yes + + yes + diff --git a/data/rc.xsd b/data/rc.xsd index bc8a8fe6..4b7d88d6 100644 --- a/data/rc.xsd +++ b/data/rc.xsd @@ -168,6 +168,7 @@ + diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index c1572eaf..76a819fc 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -94,10 +94,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) } } - menu_add_separator(menu, SEPARATOR, _("Manage desktops")); - menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); - menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), - NULL, TRUE); + if (config_menu_manage_desktops) { + menu_add_separator(menu, SEPARATOR, _("Manage desktops")); + menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); + menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), + NULL, TRUE); + } return TRUE; /* always show the menu */ } diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 0febe2e6..e6521a0a 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -153,10 +153,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) desktop_menus = g_slist_append(desktop_menus, submenu); } - menu_add_separator(menu, SEPARATOR, NULL); - menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); - menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), - NULL, TRUE); + if (config_menu_manage_desktops) { + menu_add_separator(menu, SEPARATOR, NULL); + menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); + menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), + NULL, TRUE); + } return TRUE; /* always show */ } diff --git a/openbox/config.c b/openbox/config.c index 99aa57f4..673af4bd 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -89,6 +89,7 @@ guint config_menu_hide_delay; gboolean config_menu_middle; guint config_submenu_show_delay; gboolean config_menu_client_list_icons; +gboolean config_menu_manage_desktops; GSList *config_menu_files; @@ -777,6 +778,8 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, config_submenu_show_delay = parse_int(doc, n); if ((n = parse_find_node("applicationIcons", node))) config_menu_client_list_icons = parse_bool(doc, n); + if ((n = parse_find_node("manageDesktops", node))) + config_menu_manage_desktops = parse_bool(doc, n); } } @@ -968,6 +971,7 @@ void config_startup(ObParseInst *i) config_menu_middle = FALSE; config_submenu_show_delay = 0; config_menu_client_list_icons = TRUE; + config_menu_manage_desktops = TRUE; config_menu_files = NULL; parse_register(i, "menu", parse_menu, NULL); diff --git a/openbox/config.h b/openbox/config.h index 23011a15..3fd1b879 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -177,8 +177,10 @@ extern guint config_menu_hide_delay; extern gboolean config_menu_middle; /*! Delay before opening a submenu in milliseconds */ extern guint config_submenu_show_delay; -/*! show icons in client_list_menu */ +/*! Show icons in client_list_menu */ extern gboolean config_menu_client_list_icons; +/*! Show manage desktops in client_list_menu */ +extern gboolean config_menu_manage_desktops; /*! User-specified menu files */ extern GSList *config_menu_files; /*! Per app settings */