aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2022-11-27 20:32:25 -0700
committerRonan Pigott <ronan@rjp.ie>2022-12-06 05:45:37 +0000
commitf8e70af31862970fe5b92e3beea2137bdf1bef21 (patch)
tree5e110b23fb0e34d4f124aae96b1de229642898b5
parent097ea84cda70a71ad8ea5940b3b3d277167424e5 (diff)
wlr_xdg_activation_v1: add new_token event
-rw-r--r--include/wlr/types/wlr_xdg_activation_v1.h1
-rw-r--r--types/wlr_xdg_activation_v1.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_xdg_activation_v1.h b/include/wlr/types/wlr_xdg_activation_v1.h
index f36be464..f7b038b8 100644
--- a/include/wlr/types/wlr_xdg_activation_v1.h
+++ b/include/wlr/types/wlr_xdg_activation_v1.h
@@ -46,6 +46,7 @@ struct wlr_xdg_activation_v1 {
struct {
struct wl_signal destroy;
struct wl_signal request_activate; // struct wlr_xdg_activation_v1_request_activate_event
+ struct wl_signal new_token; // struct wlr_xdg_activation_token_v1
} events;
// private state
diff --git a/types/wlr_xdg_activation_v1.c b/types/wlr_xdg_activation_v1.c
index eb8b930c..c04827bf 100644
--- a/types/wlr_xdg_activation_v1.c
+++ b/types/wlr_xdg_activation_v1.c
@@ -127,9 +127,9 @@ static void token_handle_commit(struct wl_client *client,
return;
}
- xdg_activation_token_v1_send_done(token_resource, token->token);
+ wl_signal_emit_mutable(&token->activation->events.new_token, token);
- // TODO: consider emitting a new_token event
+ xdg_activation_token_v1_send_done(token_resource, token->token);
return;
@@ -361,6 +361,7 @@ struct wlr_xdg_activation_v1 *wlr_xdg_activation_v1_create(
wl_list_init(&activation->tokens);
wl_signal_init(&activation->events.destroy);
wl_signal_init(&activation->events.request_activate);
+ wl_signal_init(&activation->events.new_token);
activation->global = wl_global_create(display,
&xdg_activation_v1_interface, XDG_ACTIVATION_V1_VERSION, activation,