From: Dana Jansens Date: Sun, 11 May 2003 19:50:30 +0000 (+0000) Subject: Menus put themselves into the stacking list. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=81cc0749f8fe6e5a1f3474c07b26de2c49648526;p=chaz%2Fopenbox Menus put themselves into the stacking list. Clicking on the menu (but not on an entry) will raise it. --- diff --git a/openbox/event.c b/openbox/event.c index 766be8fd..eecda14e 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -874,6 +874,11 @@ static void event_handle_menu(Menu *menu, XEvent *e) g_message("BUTTON PRESS"); if (e->xbutton.button == 3) menu_hide(menu); + else if (e->xbutton.button == 1) { + entry = menu_find_entry(menu, e->xbutton.window); + if (!entry) + stacking_raise(MENU_AS_WINDOW(menu)); + } break; case ButtonRelease: g_message("BUTTON RELEASED"); @@ -894,6 +899,7 @@ static void event_handle_menu(Menu *menu, XEvent *e) e->xbutton.y < (signed)(h+b)) { menu_entry_fire(entry); } + } break; case EnterNotify: @@ -909,7 +915,6 @@ static void event_handle_menu(Menu *menu, XEvent *e) menu_entry_render(entry); } break; - } } } diff --git a/openbox/menu.c b/openbox/menu.c index 7af380db..611a53bc 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -38,6 +38,8 @@ void menu_destroy_hash_value(Menu *self) g_hash_table_remove(menu_map, &self->frame); g_hash_table_remove(menu_map, &self->items); + stacking_remove(self); + appearance_free(self->a_title); XDestroyWindow(ob_display, self->title); XDestroyWindow(ob_display, self->frame); @@ -197,6 +199,9 @@ Menu *menu_new_full(char *label, char *name, Menu *parent, g_hash_table_insert(menu_map, &self->title, self); g_hash_table_insert(menu_map, &self->items, self); g_hash_table_insert(menu_hash, g_strdup(name), self); + + stacking_add(self); + return self; } @@ -355,6 +360,7 @@ void menu_control_show(Menu *self, int x, int y, Client *client) { stacking_raise(MENU_AS_WINDOW(self)); */ XMapWindow(ob_display, self->frame); + stacking_raise(MENU_AS_WINDOW(self)); self->shown = TRUE; } else if (self->shown && self->open_submenu) { menu_hide(self->open_submenu);