allow fitering spot menus

This commit is contained in:
Sean Pringle
2015-01-10 20:08:22 +10:00
parent 4d269104a1
commit 180832dcf0
5 changed files with 88 additions and 59 deletions

10
menu.c
View File

@@ -29,7 +29,6 @@ void menu_update()
if (menu->mb)
{
menubox_draw(menu->mb);
menubox_show(menu->mb);
}
}
@@ -55,12 +54,17 @@ void menu_select()
if (menu->mb)
{
id = menubox_get_id(menu->mb);
if ((c = window_build_client(menu->items[id].window)) && c)
if (id >= 0 && (c = window_build_client(menu->items[id].window)) && c)
{
if (c->manage)
client_activate(c);
client_free(c);
}
else
if (strlen(menu->mb->input->text))
{
exec_cmd(menu->mb->input->text);
}
menu_close();
}
}
@@ -116,7 +120,7 @@ void menu_create(int spot, int mon)
menubox_moveresize(mb, x, y, w, h);
menubox_key_down(mb);
menubox_draw(mb);
menubox_show(mb);
menubox_draw(mb);
menubox_grab(mb);
}