- handle_surface_configure,
- handle_surface_change_state,
- handle_surface_activated,
- handle_surface_deactivated,
- handle_surface_delete,
+ handle_xdg_surface_configure,
+ handle_xdg_surface_change_state,
+ handle_xdg_surface_activated,
+ handle_xdg_surface_deactivated,
+ handle_xdg_surface_delete,
+};
+
+static void
+handle_wl_shell_surface_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial)
+{
+ wl_shell_surface_pong(shell_surface, serial);
+}
+
+static void
+handle_wl_shell_surface_configure(void *data, struct wl_shell_surface *shell_surface,
+ unsigned int edges, int32_t width, int32_t height)
+{
+ struct window *window = data;
+
+ window_schedule_resize(window, width, height);
+}
+
+static void
+handle_wl_shell_surface_popup_done(void *data, struct wl_shell_surface *shell_surface)
+{
+ struct window *window = data;
+ struct menu *menu = window->main_surface->widget->user_data;
+
+ input_ungrab(menu->input);
+ menu_destroy(menu);
+}
+
+static const struct wl_shell_surface_listener shell_surface_listener = {
+ handle_wl_shell_surface_ping,
+ handle_wl_shell_surface_configure,
+ handle_wl_shell_surface_popup_done