xdg-shell: introduce popup_grab event

This commit is contained in:
Kirill Primak 2025-01-12 13:33:51 +03:00
parent dc6e09ffb6
commit 42dc9fbee2
3 changed files with 17 additions and 0 deletions

View file

@ -306,6 +306,14 @@ static void xdg_popup_handle_grab(struct wl_client *client,
&popup_grab->keyboard_grab);
wlr_seat_touch_start_grab(seat_client->seat,
&popup_grab->touch_grab);
struct wlr_xdg_shell_popup_grab_event event = {
.popup = popup,
.seat_client = seat_client,
.serial = serial,
};
wl_signal_emit_mutable(&popup->base->client->shell->events.popup_grab, &event);
}
static void xdg_popup_handle_reposition(

View file

@ -133,6 +133,7 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
assert(wl_list_empty(&xdg_shell->events.new_surface.listener_list));
assert(wl_list_empty(&xdg_shell->events.new_toplevel.listener_list));
assert(wl_list_empty(&xdg_shell->events.new_popup.listener_list));
assert(wl_list_empty(&xdg_shell->events.popup_grab.listener_list));
assert(wl_list_empty(&xdg_shell->events.destroy.listener_list));
wl_list_remove(&xdg_shell->display_destroy.link);
@ -166,6 +167,7 @@ struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display,
wl_signal_init(&xdg_shell->events.new_surface);
wl_signal_init(&xdg_shell->events.new_toplevel);
wl_signal_init(&xdg_shell->events.new_popup);
wl_signal_init(&xdg_shell->events.popup_grab);
wl_signal_init(&xdg_shell->events.destroy);
xdg_shell->display_destroy.notify = handle_display_destroy;