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);
}
return shortcut;
}
-static void parse_menu_item(xmlNodePtr node, gpointer data)
+static void parse_menu_item(xmlNodePtr node, gpointer data)
{
ObMenuParseState *state = data;
gchar *label;
/* Don't try to extract "icon" attribute if icons in user-defined
menus are not enabled. */
- if (obt_xml_attr_string(node, "label", &label)) {
+ if (obt_xml_attr_string_unstripped(node, "label", &label)) {
xmlNodePtr c;
GSList *acts = NULL;
if (state->parent) {
gchar *label;
- if (!obt_xml_attr_string(node, "label", &label))
+ if (!obt_xml_attr_string_unstripped(node, "label", &label))
label = NULL;
menu_add_separator(state->parent, -1, label);
goto parse_menu_fail;
if (!g_hash_table_lookup(menu_hash, name)) {
- if (!obt_xml_attr_string(node, "label", &title))
+ if (!obt_xml_attr_string_unstripped(node, "label", &title))
goto parse_menu_fail;
if ((menu = menu_new(name, title, TRUE, NULL))) {
return FALSE; /* no repeat */
}
-void menu_show(gchar *name, gint x, gint y, gboolean mouse, ObClient *client)
+void menu_show(gchar *name, const GravityPoint *pos, gint monitor,
+ gboolean mouse, gboolean user_positioned, ObClient *client)
{
ObMenu *self;
ObMenuFrame *frame;
menu_clear_pipe_caches();
frame = menu_frame_new(self, 0, client);
- if (!menu_frame_show_topmenu(frame, x, y, mouse))
+ if (!menu_frame_show_topmenu(frame, pos, monitor, mouse, user_positioned))
menu_frame_free(frame);
else {
if (!mouse) {