diff options
| author | Dana Jansens <danakj@orodu.net> | 2012-09-30 21:23:58 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2012-10-06 21:56:56 -0400 |
| commit | 51d735672c7a726655867b703d07e390781939de (patch) | |
| tree | c6e05240503112e769a52ede152647222fe45672 | |
| parent | dc4cfa94c9cd7bd30cdc87a6e4ab8174d8a9703f (diff) | |
Allow loading of menu files outside of your XDG_CONFIG_HOME (Fix bug 5711)
When the given file name can not be found in your XDG_CONFIG_HOME, ie in
~/.config/openbox, then try the file name directly.
This means if you specify a menu file such as "/home/dana/helloworld.xml",
openbox will try, in order:
1) ~/.config/openbox/home/dana/helloworld.xml
2) /home/dana/helloworld.xml
And it will load the file you meant when it tries the second one.
| -rw-r--r-- | openbox/menu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/openbox/menu.c b/openbox/menu.c index eaf081d9..7c49cedb 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -90,7 +90,16 @@ void menu_startup(gboolean reconfig) loaded = TRUE; obt_xml_tree_from_root(menu_parse_inst); obt_xml_close(menu_parse_inst); - } else + } + else if (obt_xml_load_file(menu_parse_inst, + it->data, + "openbox_menu")) + { + loaded = TRUE; + obt_xml_tree_from_root(menu_parse_inst); + obt_xml_close(menu_parse_inst); + } + else g_message(_("Unable to find a valid menu file \"%s\""), (const gchar*)it->data); } |
