aboutsummaryrefslogtreecommitdiffstats
path: root/sway/xdg_activation_v1.c
diff options
context:
space:
mode:
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