Menus put themselves into the stacking list.
Clicking on the menu (but not on an entry) will raise it.
This commit is contained in:
parent
58cfbb7f84
commit
81cc0749f8
2 changed files with 12 additions and 1 deletions
|
@ -874,6 +874,11 @@ static void event_handle_menu(Menu *menu, XEvent *e)
|
||||||
g_message("BUTTON PRESS");
|
g_message("BUTTON PRESS");
|
||||||
if (e->xbutton.button == 3)
|
if (e->xbutton.button == 3)
|
||||||
menu_hide(menu);
|
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;
|
break;
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
g_message("BUTTON RELEASED");
|
g_message("BUTTON RELEASED");
|
||||||
|
@ -894,6 +899,7 @@ static void event_handle_menu(Menu *menu, XEvent *e)
|
||||||
e->xbutton.y < (signed)(h+b)) {
|
e->xbutton.y < (signed)(h+b)) {
|
||||||
menu_entry_fire(entry);
|
menu_entry_fire(entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
|
@ -909,7 +915,6 @@ static void event_handle_menu(Menu *menu, XEvent *e)
|
||||||
menu_entry_render(entry);
|
menu_entry_render(entry);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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->frame);
|
||||||
g_hash_table_remove(menu_map, &self->items);
|
g_hash_table_remove(menu_map, &self->items);
|
||||||
|
|
||||||
|
stacking_remove(self);
|
||||||
|
|
||||||
appearance_free(self->a_title);
|
appearance_free(self->a_title);
|
||||||
XDestroyWindow(ob_display, self->title);
|
XDestroyWindow(ob_display, self->title);
|
||||||
XDestroyWindow(ob_display, self->frame);
|
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->title, self);
|
||||||
g_hash_table_insert(menu_map, &self->items, self);
|
g_hash_table_insert(menu_map, &self->items, self);
|
||||||
g_hash_table_insert(menu_hash, g_strdup(name), self);
|
g_hash_table_insert(menu_hash, g_strdup(name), self);
|
||||||
|
|
||||||
|
stacking_add(self);
|
||||||
|
|
||||||
return 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));
|
stacking_raise(MENU_AS_WINDOW(self));
|
||||||
*/
|
*/
|
||||||
XMapWindow(ob_display, self->frame);
|
XMapWindow(ob_display, self->frame);
|
||||||
|
stacking_raise(MENU_AS_WINDOW(self));
|
||||||
self->shown = TRUE;
|
self->shown = TRUE;
|
||||||
} else if (self->shown && self->open_submenu) {
|
} else if (self->shown && self->open_submenu) {
|
||||||
menu_hide(self->open_submenu);
|
menu_hide(self->open_submenu);
|
||||||
|
|
Loading…
Reference in a new issue