From b3cca0a41130ff45b70b730cb8f2273dd91531a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 4 Jan 2012 22:19:14 -0500 Subject: shell: Start implementing the popup surface type This lands the basic behavior of the popup surface type, but there are still a number of details to be worked out. Mainly there's a hardcoded timeout to handle the case of releasing the popup button outside any of the client windows, which triggers popup_end if it happens after the timeout. Maybe we just need to add that as an argument, or we could add a new event that fires in this case to let the client decide whether it ends the popup or not. --- clients/resizor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clients/resizor.c') diff --git a/clients/resizor.c b/clients/resizor.c index 2f32ad5b..867ceb90 100644 --- a/clients/resizor.c +++ b/clients/resizor.c @@ -167,7 +167,7 @@ key_handler(struct window *window, struct input *input, uint32_t time, } static void -show_menu(struct resizor *resizor, struct input *input) +show_menu(struct resizor *resizor, struct input *input, uint32_t time) { int32_t x, y; static const char *entries[] = { @@ -176,7 +176,7 @@ show_menu(struct resizor *resizor, struct input *input) input_get_position(input, &x, &y); resizor->menu = window_create_menu(resizor->display, - resizor->window, + input, time, resizor->window, x - 10, y - 10, entries, 4); window_schedule_redraw(resizor->menu); @@ -192,7 +192,7 @@ button_handler(struct window *window, switch (button) { case BTN_RIGHT: if (state) - show_menu(resizor, input); + show_menu(resizor, input, time); break; } } -- cgit v1.2.3