self->text = createWindow(self->window, 0, NULL);
g_hash_table_insert(menu_frame_map, &self->window, self);
g_hash_table_insert(menu_frame_map, &self->text, self);
- if (entry->type == OB_MENU_ENTRY_TYPE_NORMAL) {
+ if ((entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) {
self->icon = createWindow(self->window, 0, NULL);
g_hash_table_insert(menu_frame_map, &self->icon, self);
}
XDestroyWindow(obt_display, self->window);
g_hash_table_remove(menu_frame_map, &self->text);
g_hash_table_remove(menu_frame_map, &self->window);
- if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) {
+ if ((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) {
XDestroyWindow(obt_display, self->icon);
g_hash_table_remove(menu_frame_map, &self->icon);
}
g_assert_not_reached();
}
- if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
+ if (((self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) ||
+ (self->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)) &&
self->entry->data.normal.icon)
{
RrAppearance *clear;
parent->child_entry = parent_entry;
}
- if (!menu_frame_show(self))
+ if (!menu_frame_show(self)) {
+ parent->child = NULL;
+ parent->child_entry = NULL;
return FALSE;
+ }
menu_frame_place_submenu(self, &x, &y);
menu_frame_move_on_screen(self, x, y, &dx, &dy);
/* pass our direction on to our child */
f->direction_right = self->frame->direction_right;
- menu_frame_show_submenu(f, self->frame, self);
+ if (!menu_frame_show_submenu(f, self->frame, self))
+ menu_frame_free(f);
}
void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)