#define ENTRY_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
ButtonPressMask | ButtonReleaseMask)
+void menu_control_show(ObMenu *self, int x, int y, ObClient *client);
+
static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
gpointer data)
{
xmlNodePtr nact;
gchar *id = NULL, *title = NULL, *label = NULL, *plugin;
- ObMenu *menu = NULL, *parent;
+ ObMenu *menu = NULL, *parent = NULL;
if (newmenu == TRUE) {
if (!parse_attr_string("id", node, &id))
data.parent = menu;
if (plugin_open_reopen(plugin, i))
- parent = plugin_create(plugin, &data);
+ menu = plugin_create(plugin, &data);
g_free(plugin);
} else
menu = menu_new(title, id, data ? *((ObMenu**)data) : NULL);
- if (data)
+ if (data && menu)
*((ObMenu**)data) = menu;
} else {
menu = (ObMenu *)data;
} else {
parent = menu;
parse_menu(i, doc, node, &parent);
+ }
+
+ if (parent)
menu_add_entry(menu, menu_entry_new_submenu(parent->label,
parent));
- }
}
else if (!xmlStrcasecmp(node->name, (const xmlChar*) "item")) {
g_free(title);
}
-void menu_control_show(ObMenu *self, int x, int y, ObClient *client);
-
void menu_destroy_hash_key(ObMenu *menu)
{
g_free(menu);
a = screen_physical_area_monitor(self->parent->xin_area);
- if (self->submenu->size.width + x >= a->x + a->width) {
+ if (self->submenu->size.width + x + ob_rr_theme->bwidth >=
+ a->x + a->width) {
int newparentx = a->x + a->width
- self->submenu->size.width
- self->parent->size.width
- - ob_rr_theme->bwidth
+ - ob_rr_theme->bwidth * 2
- ob_rr_theme->menu_overlap;
x = a->x + a->width - self->submenu->size.width
}
menu_show_full(self->submenu, x,
- self->parent->location.y + self->y,
+ self->parent->location.y + self->y +
+ self->parent->title_h + ob_rr_theme->bwidth,
self->parent->client);
}
self->hilite = TRUE;