aboutsummaryrefslogtreecommitdiffstats
path: root/sway/xdg_activation_v1.c
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <ronan@rjp.ie>2022-11-18 20:05:24 -0700
committerLibravatar Simon Ser <contact@emersion.fr>2022-11-26 09:48:58 +0100
commit30ad4dc4a5a41ce7c7aa85096a6e18f374172983 (patch)
tree9b88b2c72174819ddc7f59b6cda52d28014986d7 /sway/xdg_activation_v1.c
parentlauncher: fudge the interface a bit (diff)
downloadsway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.tar.gz
sway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.tar.zst
sway-30ad4dc4a5a41ce7c7aa85096a6e18f374172983.zip
launcher: export xdga tokens and use them for workspace matching
Diffstat (limited to 'sway/xdg_activation_v1.c')
-rw-r--r--sway/xdg_activation_v1.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/xdg_activation_v1.c b/sway/xdg_activation_v1.c
index 99e7f9b5..2b94136c 100644
--- a/sway/xdg_activation_v1.c
+++ b/sway/xdg_activation_v1.c
@@ -1,4 +1,5 @@
1#include <wlr/types/wlr_xdg_activation_v1.h> 1#include <wlr/types/wlr_xdg_activation_v1.h>
2#include "sway/desktop/launcher.h"
2#include "sway/tree/view.h" 3#include "sway/tree/view.h"
3 4
4void xdg_activation_v1_handle_request_activate(struct wl_listener *listener, 5void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
@@ -15,7 +16,22 @@ void xdg_activation_v1_handle_request_activate(struct wl_listener *listener,
15 return; 16 return;
16 } 17 }
17 struct sway_view *view = xdg_surface->data; 18 struct sway_view *view = xdg_surface->data;
18 if (!xdg_surface->mapped || view == NULL) { 19 if (view == NULL) {
20 return;
21 }
22
23 if (!xdg_surface->mapped) {
24 // This is a startup notification. If we are tracking it, the data
25 // field is a launcher_ctx.
26 struct launcher_ctx *ctx = event->token->data;
27 if (!ctx || ctx->activated) {
28 // This ctx has already been activated and cannot be used again
29 // for a startup notification. It will be destroyed
30 return;
31 } else {
32 ctx->activated = true;
33 view_assign_ctx(view, ctx);
34 }
19 return; 35 return;
20 } 36 }
21 37