aboutsummaryrefslogtreecommitdiff
path: root/sway/xdg_activation_v1.c
diff options
context:
space:
mode:
authorRonan Pigott <ronan@rjp.ie>2022-11-30 11:54:50 -0700
committerRonan Pigott <ronan@rjp.ie>2023-02-05 00:53:47 -0700
commit4cda9ee3a3aa122f3f1a6f570d8befa78083c1b5 (patch)
treedbb1675b116264d102847d929dec5a9c76c3c88d /sway/xdg_activation_v1.c
parentdbc1eec850d75b9d4b88960cce057d5286cb9dc0 (diff)
launcher: support external launcher tokens
Diffstat (limited to 'sway/xdg_activation_v1.c')
-rw-r--r--sway/xdg_activation_v1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c
index c20e42c1..614f51cd 100644
--- a/sway/xdg_activation_v1.c
+++ b/sway/xdg_activation_v1.c
@@ -1,6 +1,7 @@
#include <wlr/types/wlr_xdg_activation_v1.h>
#include "sway/desktop/launcher.h"
#include "sway/tree/view.h"
+#include "sway/tree/workspace.h"
void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
void *data) {
@@ -38,3 +39,15 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
view_request_activate(view, seat);
}
}
+
+void xdg_activation_v1_handle_new_token(struct wl_listener *listener, void *data) {
+ struct wlr_xdg_activation_token_v1 *token = data;
+ struct sway_seat *seat = token->seat ? token->seat->data :
+ input_manager_current_seat();
+
+ struct sway_workspace *ws = seat_get_focused_workspace(seat);
+ if (ws) {
+ launcher_ctx_create(token, &ws->node);
+ return;
+ }
+}