-void menu_control_mouseover(MenuEntry *self, gboolean enter) {
- int x;
- Rect *a;
-
- self->hilite = enter;
-
- if (enter) {
- if (self->parent->open_submenu && self->submenu
- != self->parent->open_submenu)
- menu_hide(self->parent->open_submenu);
-
- if (self->submenu && self->parent->open_submenu != self->submenu) {
- self->parent->open_submenu = self->submenu;
-
- /* shouldn't be invalid since it must be displayed */
- g_assert(!self->parent->invalid);
- /* TODO: I don't understand why these bevels should be here.
- Something must be wrong in the width calculation */
- x = self->parent->location.x + self->parent->size.width +
- ob_rr_theme->bwidth;
-
- /* need to get the width. is this bad?*/
- menu_render(self->submenu);
-
- a = screen_physical_area_xinerama(self->parent->xin_area);
-
- if (self->submenu->size.width + x >= a->x + a->width)
- x = self->parent->location.x - self->submenu->size.width -
- ob_rr_theme->bwidth;
-
- menu_show_full(self->submenu, x,
- self->parent->location.y + self->y,
- self->parent->client);
- }
+void menu_find_submenus(ObMenu *self)
+{
+ GList *it;
+
+ for (it = self->entries; it; it = g_list_next(it)) {
+ ObMenuEntry *e = it->data;
+
+ if (e->type == OB_MENU_ENTRY_TYPE_SUBMENU)
+ e->data.submenu.submenu = menu_from_name(e->data.submenu.name);