X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=979e834ff60d0f2c8f8edb1db3f04b255e302747;hb=2b8b5da04b14af1639143cc332874c7e1a03a8bb;hp=6a25a9aece93d8daa1bbc627f3e6257bfcfaee20;hpb=fbc7607fbd1a380428a53094e727ac7631871bd4;p=chaz%2Fopenbox diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 6a25a9ae..979e834f 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -401,6 +401,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) text_a->texture[0].data.text.string = self->entry->data.normal.label; if (self->entry->data.normal.shortcut && (self->frame->menu->show_all_shortcuts || + self->entry->data.normal.shortcut_always_show || self->entry->data.normal.shortcut_position > 0)) { text_a->texture[0].data.text.shortcut = TRUE; @@ -416,6 +417,7 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) sub = self->entry->data.submenu.submenu; text_a->texture[0].data.text.string = sub ? sub->title : ""; if (sub->shortcut && (self->frame->menu->show_all_shortcuts || + sub->shortcut_always_show || sub->shortcut_position > 0)) { text_a->texture[0].data.text.shortcut = TRUE; @@ -603,7 +605,7 @@ static gint menu_entry_frame_get_height(ObMenuEntryFrame *self, if (self->entry->data.separator.label != NULL) { h += ob_rr_theme->menu_title_height + (ob_rr_theme->mbwidth - PADDING) * 2; - + /* if the first entry is a labeled separator, then make its border overlap with the menu's outside border */ if (first_entry) @@ -635,9 +637,9 @@ void menu_frame_render(ObMenuFrame *self) STRUT_SET(self->item_margin, 0, 0, 0, 0); if (self->entries) { - ObMenuEntryFrame *e = self->entries->data; gint l, t, r, b; + e = self->entries->data; e->a_text_normal->texture[0].data.text.string = ""; tw = RrMinWidth(e->a_text_normal); tw += 2*PADDING; @@ -692,7 +694,8 @@ void menu_frame_render(ObMenuFrame *self) } RECT_SET_POINT(e->area, 0, h+e->border); - XMoveWindow(ob_display, e->window, e->area.x-e->border, e->area.y-e->border); + XMoveWindow(ob_display, e->window, + e->area.x-e->border, e->area.y-e->border); XSetWindowBorderWidth(ob_display, e->window, e->border); XSetWindowBorder(ob_display, e->window, RrColorPixel(ob_rr_theme->menu_border_color)); @@ -885,7 +888,7 @@ static void menu_frame_update(ObMenuFrame *self) more_frame = menu_entry_frame_new(more_entry, self); /* make it get deleted when the menu frame goes away */ menu_entry_unref(more_entry); - + /* add our More... entry to the frame */ self->entries = g_list_append(self->entries, more_frame); } @@ -1054,7 +1057,7 @@ static void menu_frame_hide(ObMenuFrame *self) menu_frame_free(self); } -void menu_frame_hide_all() +void menu_frame_hide_all(void) { GList *it; @@ -1072,8 +1075,14 @@ void menu_frame_hide_all_client(ObClient *client) GList *it = g_list_last(menu_frame_visible); if (it) { ObMenuFrame *f = it->data; - if (f->client == client) + if (f->client == client) { + if (config_submenu_show_delay) { + /* remove any submenu open requests */ + ob_main_loop_timeout_remove(ob_main_loop, + menu_entry_frame_submenu_timeout); + } menu_frame_hide(f); + } } } @@ -1118,6 +1127,7 @@ ObMenuEntryFrame* menu_entry_frame_under(gint x, gint y) static gboolean menu_entry_frame_submenu_timeout(gpointer data) { + g_assert(menu_frame_visible); menu_entry_frame_show_submenu((ObMenuEntryFrame*)data); return FALSE; } @@ -1132,8 +1142,8 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry, entry = old; if (old == entry) return; - - if (config_submenu_show_delay) { + + if (config_submenu_show_delay) { /* remove any submenu open requests */ ob_main_loop_timeout_remove(ob_main_loop, menu_entry_frame_submenu_timeout); @@ -1203,7 +1213,7 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state) func(entry, frame, client, state, data); else actions_run_acts(acts, OB_USER_ACTION_MENU_SELECTION, - state, -1, -1, OB_FRAME_CONTEXT_NONE, client); + state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, client); } }