mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
xdg-shell: introduce popup_grab event
This commit is contained in:
parent
dc6e09ffb6
commit
42dc9fbee2
3 changed files with 17 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ struct wlr_xdg_shell {
|
||||||
struct wl_signal new_surface; // struct wlr_xdg_surface
|
struct wl_signal new_surface; // struct wlr_xdg_surface
|
||||||
struct wl_signal new_toplevel; // struct wlr_xdg_toplevel
|
struct wl_signal new_toplevel; // struct wlr_xdg_toplevel
|
||||||
struct wl_signal new_popup; // struct wlr_xdg_popup
|
struct wl_signal new_popup; // struct wlr_xdg_popup
|
||||||
|
struct wl_signal popup_grab; // struct wlr_xdg_shell_popup_grab_event
|
||||||
struct wl_signal destroy;
|
struct wl_signal destroy;
|
||||||
} events;
|
} events;
|
||||||
|
|
||||||
|
|
@ -36,6 +37,12 @@ struct wlr_xdg_shell {
|
||||||
} WLR_PRIVATE;
|
} WLR_PRIVATE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct wlr_xdg_shell_popup_grab_event {
|
||||||
|
struct wlr_xdg_popup *popup;
|
||||||
|
struct wlr_seat_client *seat_client;
|
||||||
|
uint32_t serial;
|
||||||
|
};
|
||||||
|
|
||||||
struct wlr_xdg_client {
|
struct wlr_xdg_client {
|
||||||
struct wlr_xdg_shell *shell;
|
struct wlr_xdg_shell *shell;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
|
|
|
||||||
|
|
@ -306,6 +306,14 @@ static void xdg_popup_handle_grab(struct wl_client *client,
|
||||||
&popup_grab->keyboard_grab);
|
&popup_grab->keyboard_grab);
|
||||||
wlr_seat_touch_start_grab(seat_client->seat,
|
wlr_seat_touch_start_grab(seat_client->seat,
|
||||||
&popup_grab->touch_grab);
|
&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(
|
static void xdg_popup_handle_reposition(
|
||||||
|
|
|
||||||
|
|
@ -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_surface.listener_list));
|
||||||
assert(wl_list_empty(&xdg_shell->events.new_toplevel.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.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));
|
assert(wl_list_empty(&xdg_shell->events.destroy.listener_list));
|
||||||
|
|
||||||
wl_list_remove(&xdg_shell->display_destroy.link);
|
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_surface);
|
||||||
wl_signal_init(&xdg_shell->events.new_toplevel);
|
wl_signal_init(&xdg_shell->events.new_toplevel);
|
||||||
wl_signal_init(&xdg_shell->events.new_popup);
|
wl_signal_init(&xdg_shell->events.new_popup);
|
||||||
|
wl_signal_init(&xdg_shell->events.popup_grab);
|
||||||
wl_signal_init(&xdg_shell->events.destroy);
|
wl_signal_init(&xdg_shell->events.destroy);
|
||||||
|
|
||||||
xdg_shell->display_destroy.notify = handle_display_destroy;
|
xdg_shell->display_destroy.notify = handle_display_destroy;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue