diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/exec_always.c | 4 | ||||
-rw-r--r-- | sway/config/bar.c | 4 | ||||
-rw-r--r-- | sway/input/seat.c | 8 | ||||
-rw-r--r-- | sway/tree/view.c | 5 |
4 files changed, 17 insertions, 4 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 9bf2b320..c730cb8b 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -4,6 +4,7 @@ #include <string.h> #include <sys/wait.h> #include <unistd.h> +#include <signal.h> #include "sway/commands.h" #include "sway/config.h" #include "sway/tree/container.h" @@ -47,6 +48,9 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { if ((pid = fork()) == 0) { // Fork child process again setsid(); + sigset_t set; + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); close(fd[0]); if ((child = fork()) == 0) { close(fd[1]); diff --git a/sway/config/bar.c b/sway/config/bar.c index 3a74331e..ae9383d6 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c @@ -10,6 +10,7 @@ #include <sys/stat.h> #include <signal.h> #include <strings.h> +#include <signal.h> #include "sway/config.h" #include "stringop.h" #include "list.h" @@ -175,6 +176,9 @@ void invoke_swaybar(struct bar_config *bar) { if (bar->pid == 0) { setpgid(0, 0); close(filedes[0]); + sigset_t set; + sigemptyset(&set); + sigprocmask(SIG_SETMASK, &set, NULL); // run custom swaybar size_t len = snprintf(NULL, 0, "%s -b %s", diff --git a/sway/input/seat.c b/sway/input/seat.c index 869560af..dd4d5c3b 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -775,8 +775,12 @@ void seat_set_focus_warp(struct sway_seat *seat, } } - if (container->type == C_VIEW) { - ipc_event_window(container, "focus"); + if (container) { + if (container->type == C_VIEW) { + ipc_event_window(container, "focus"); + } else if (container->type == C_WORKSPACE) { + ipc_event_workspace(NULL, container, "focus"); + } } seat->has_focus = (container != NULL); diff --git a/sway/tree/view.c b/sway/tree/view.c index 051b93ce..97318daa 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -496,7 +496,7 @@ static struct sway_container *select_workspace(struct sway_view *view) { } // Use the focused workspace - ws = seat_get_focus(seat); + ws = seat_get_focus_inactive(seat, &root_container); if (ws->type != C_WORKSPACE) { ws = container_parent(ws, C_WORKSPACE); } @@ -505,7 +505,8 @@ static struct sway_container *select_workspace(struct sway_view *view) { static bool should_focus(struct sway_view *view) { struct sway_seat *seat = input_manager_current_seat(input_manager); - struct sway_container *prev_focus = seat_get_focus(seat); + struct sway_container *prev_focus = + seat_get_focus_inactive(seat, &root_container); struct sway_container *prev_ws = prev_focus->type == C_WORKSPACE ? prev_focus : container_parent(prev_focus, C_WORKSPACE); struct sway_container *map_ws = container_parent(view->swayc, C_WORKSPACE); |