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.
diff --git a/clients/resizor.c b/clients/resizor.c
index 2f32ad5..867ceb9 100644
--- a/clients/resizor.c
+++ b/clients/resizor.c
@@ -167,7 +167,7 @@
}
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 @@
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 @@
switch (button) {
case BTN_RIGHT:
if (state)
- show_menu(resizor, input);
+ show_menu(resizor, input, time);
break;
}
}