aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,