sway/include/sway/desktop/launcher.h
Ronan Pigott aabff469c6 commands/exec: enable targeted exec
Cause sway's internal launcher contexts to inherit the workspace of the
handler context, rather than the focused workspace. This has the same
behavior by default, but enables criteria targeted exec commands such as

'[workspace=3]' exec foot

to launch a client on workspace 3.
2023-02-12 10:57:10 -07:00

36 lines
888 B
C

#ifndef _SWAY_LAUNCHER_H
#define _SWAY_LAUNCHER_H
#include <stdlib.h>
#include <wayland-server-core.h>
struct launcher_ctx {
pid_t pid;
char *fallback_name;
struct wlr_xdg_activation_token_v1 *token;
struct wl_listener token_destroy;
bool activated;
struct sway_node *node;
struct wl_listener node_destroy;
struct wl_list link; // sway_server::pending_launcher_ctxs
};
struct launcher_ctx *launcher_ctx_find_pid(pid_t pid);
struct sway_workspace *launcher_ctx_get_workspace(struct launcher_ctx *ctx);
void launcher_ctx_consume(struct launcher_ctx *ctx);
void launcher_ctx_destroy(struct launcher_ctx *ctx);
struct launcher_ctx *launcher_ctx_create_internal(struct sway_node *node);
struct launcher_ctx *launcher_ctx_create(
struct wlr_xdg_activation_token_v1 *token, struct sway_node *node);
const char *launcher_ctx_get_token_name(struct launcher_ctx *ctx);
#endif