mirror of
https://github.com/swaywm/sway.git
synced 2026-06-08 03:02:23 -04:00
launcher: export xdga tokens and use them for workspace matching
This commit is contained in:
parent
bdeb9f9565
commit
30ad4dc4a5
4 changed files with 38 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include <wlr/types/wlr_xdg_activation_v1.h>
|
||||
#include "sway/desktop/launcher.h"
|
||||
#include "sway/tree/view.h"
|
||||
|
||||
void 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,
|
|||
return;
|
||||
}
|
||||
struct sway_view *view = xdg_surface->data;
|
||||
if (!xdg_surface->mapped || view == NULL) {
|
||||
if (view == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xdg_surface->mapped) {
|
||||
// This is a startup notification. If we are tracking it, the data
|
||||
// field is a launcher_ctx.
|
||||
struct launcher_ctx *ctx = event->token->data;
|
||||
if (!ctx || ctx->activated) {
|
||||
// This ctx has already been activated and cannot be used again
|
||||
// for a startup notification. It will be destroyed
|
||||
return;
|
||||
} else {
|
||||
ctx->activated = true;
|
||||
view_assign_ctx(view, ctx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue