X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=b235f5eb459d93c5bef80d4d5a53abc22cb99215;hp=57f2943886767a15a4a11a2f842faf8431897766;hb=567fd15eebdd44e50cef140419dbf7a336708109;hpb=3e9dbc01430193035e3d1f5832c019c3f9623db8 diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 57f29438..b235f5eb 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -1300,7 +1300,7 @@ void menu_frame_select_previous(ObMenuFrame *self) } } } - menu_frame_select(self, it ? it->data : NULL, TRUE); + menu_frame_select(self, it ? it->data : NULL, FALSE); } void menu_frame_select_next(ObMenuFrame *self) @@ -1325,5 +1325,37 @@ void menu_frame_select_next(ObMenuFrame *self) } } } - menu_frame_select(self, it ? it->data : NULL, TRUE); + menu_frame_select(self, it ? it->data : NULL, FALSE); +} + +void menu_frame_select_first(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = self->entries; it; it = g_list_next(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); +} + +void menu_frame_select_last(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = g_list_last(self->entries); it; it = g_list_previous(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); }