mirror of
https://github.com/swaywm/sway.git
synced 2026-04-21 06:46:22 -04:00
Merge aabff469c6 into dadf3e9b78
This commit is contained in:
commit
85a0b02bf4
3 changed files with 12 additions and 8 deletions
|
|
@ -26,7 +26,7 @@ void launcher_ctx_consume(struct launcher_ctx *ctx);
|
||||||
|
|
||||||
void launcher_ctx_destroy(struct launcher_ctx *ctx);
|
void launcher_ctx_destroy(struct launcher_ctx *ctx);
|
||||||
|
|
||||||
struct launcher_ctx *launcher_ctx_create_internal(void);
|
struct launcher_ctx *launcher_ctx_create_internal(struct sway_node *node);
|
||||||
|
|
||||||
struct launcher_ctx *launcher_ctx_create(
|
struct launcher_ctx *launcher_ctx_create(
|
||||||
struct wlr_xdg_activation_token_v1 *token, struct sway_node *node);
|
struct wlr_xdg_activation_token_v1 *token, struct sway_node *node);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pid_t pid, child;
|
pid_t pid, child;
|
||||||
struct launcher_ctx *ctx = launcher_ctx_create_internal();
|
struct sway_workspace *ws = config->handler_context.workspace;
|
||||||
|
struct launcher_ctx *ctx = launcher_ctx_create_internal(&ws->node);
|
||||||
// Fork process
|
// Fork process
|
||||||
if ((pid = fork()) == 0) {
|
if ((pid = fork()) == 0) {
|
||||||
// Fork child process again
|
// Fork child process again
|
||||||
|
|
|
||||||
|
|
@ -228,19 +228,22 @@ struct launcher_ctx *launcher_ctx_create(struct wlr_xdg_activation_token_v1 *tok
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates a context with a new token for the internal launcher
|
// Creates a context with a new token for the internal launcher
|
||||||
struct launcher_ctx *launcher_ctx_create_internal() {
|
struct launcher_ctx *launcher_ctx_create_internal(struct sway_node *node) {
|
||||||
struct sway_seat *seat = input_manager_current_seat();
|
struct sway_seat *seat = input_manager_current_seat();
|
||||||
struct sway_workspace *ws = seat_get_focused_workspace(seat);
|
if (!node) {
|
||||||
if (!ws) {
|
struct sway_workspace *ws = seat_get_focused_workspace(seat);
|
||||||
sway_log(SWAY_DEBUG, "Failed to create launch context. No workspace.");
|
if (!ws) {
|
||||||
return NULL;
|
sway_log(SWAY_DEBUG, "Failed to create launch context. No workspace.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
node = &ws->node;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_xdg_activation_token_v1 *token =
|
struct wlr_xdg_activation_token_v1 *token =
|
||||||
wlr_xdg_activation_token_v1_create(server.xdg_activation_v1);
|
wlr_xdg_activation_token_v1_create(server.xdg_activation_v1);
|
||||||
token->seat = seat->wlr_seat;
|
token->seat = seat->wlr_seat;
|
||||||
|
|
||||||
struct launcher_ctx *ctx = launcher_ctx_create(token, &ws->node);
|
struct launcher_ctx *ctx = launcher_ctx_create(token, node);
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
wlr_xdg_activation_token_v1_destroy(token);
|
wlr_xdg_activation_token_v1_destroy(token);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue