hilight the first normal entry also if there is a menuheader/separator before it
This commit is contained in:
parent
914d18f364
commit
7f9080c6a0
1 changed files with 12 additions and 4 deletions
|
@ -396,11 +396,19 @@ void menu_show(gchar *name, gint x, gint y, gint button, ObClient *client)
|
||||||
frame = menu_frame_new(self, 0, client);
|
frame = menu_frame_new(self, 0, client);
|
||||||
if (!menu_frame_show_topmenu(frame, x, y, button))
|
if (!menu_frame_show_topmenu(frame, x, y, button))
|
||||||
menu_frame_free(frame);
|
menu_frame_free(frame);
|
||||||
else if (frame->entries) {
|
else {
|
||||||
/* select the first entry if it's not a submenu */
|
/* select the first entry if it's not a submenu */
|
||||||
ObMenuEntryFrame *e = frame->entries->data;
|
GList *it = frame->entries;
|
||||||
if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
|
while (it) {
|
||||||
menu_frame_select(frame, e, FALSE);
|
ObMenuEntryFrame *e = it->data;
|
||||||
|
if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) {
|
||||||
|
menu_frame_select(frame, e, FALSE);
|
||||||
|
break;
|
||||||
|
} else if (e->entry->type == OB_MENU_ENTRY_TYPE_SEPARATOR)
|
||||||
|
it = g_list_next(it);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue