From: Dana Jansens Date: Sat, 19 May 2007 20:58:10 +0000 (+0000) Subject: fix escape's behavior in menus. make static stuff that shouldnt be used by others X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=83da4ec9398d197f39461cd7305163b2676840c8;p=chaz%2Fopenbox fix escape's behavior in menus. make static stuff that shouldnt be used by others --- diff --git a/openbox/event.c b/openbox/event.c index 8f211202..ace548a6 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1482,8 +1482,11 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) ret = FALSE; else if (keycode == ob_keycode(OB_KEY_ESCAPE) && state == 0) { - /* Escape closes the active menu */ - menu_frame_hide(frame); + /* Escape goes to the parent menu or closes the last one */ + if (frame->parent) + menu_frame_select(frame, NULL, TRUE); + else + menu_frame_hide_all(); } else if (keycode == ob_keycode(OB_KEY_RETURN) && (state == 0 || diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 68ea4949..b908ad4f 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -45,6 +45,7 @@ static ObMenuEntryFrame* menu_entry_frame_new(ObMenuEntry *entry, static void menu_entry_frame_free(ObMenuEntryFrame *self); static void menu_frame_update(ObMenuFrame *self); static gboolean menu_entry_frame_submenu_timeout(gpointer data); +static void menu_frame_hide(ObMenuFrame *self); static Window createWindow(Window parent, gulong mask, XSetWindowAttributes *attrib) @@ -1013,7 +1014,7 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, return TRUE; } -void menu_frame_hide(ObMenuFrame *self) +static void menu_frame_hide(ObMenuFrame *self) { GList *it = g_list_find(menu_frame_visible, self); diff --git a/openbox/menuframe.h b/openbox/menuframe.h index 4f896ec8..e1f4b15b 100644 --- a/openbox/menuframe.h +++ b/openbox/menuframe.h @@ -128,7 +128,6 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, gint button); gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, ObMenuEntryFrame *parent_entry); -void menu_frame_hide(ObMenuFrame *self); void menu_frame_hide_all(); void menu_frame_hide_all_client(struct _ObClient *client);