aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-09-23 08:38:15 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-09-23 08:39:11 +1000
commitcb66bbea42adeabd7bd87132a66589e14a46940f (patch)
tree43f409e1619b2deded320f0af7064e73e3969d30 /sway/desktop
parent082488a81c491faa71ddc2c87fe985ef28f5d69d (diff)
downloadsway-cb66bbea42adeabd7bd87132a66589e14a46940f.tar.xz
Allow running commands on containers without focusing them
This adds a `con` argument to `execute_command` which allows you to specify the container to execute the command on. In most cases it leaves it as `NULL` which makes it use the focused node. We only set it when executing `for_window` criteria such as when a view maps. This means we don't send unnecessary IPC focus events, and fixes a crash when the criteria command is `move scratchpad` (because we can't give focus to a hidden scratchpad container). Each of the shell map handlers now check to see if the view has a workspace. It won't have a workspace if criteria has moved it to the scratchpad.
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/xdg_shell.c2
-rw-r--r--sway/desktop/xdg_shell_v6.c2
-rw-r--r--sway/desktop/xwayland.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 00448be7..6d1ccdd7 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -401,7 +401,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
} else {
if (view->container->parent) {
arrange_container(view->container->parent);
- } else {
+ } else if (view->container->workspace) {
arrange_workspace(view->container->workspace);
}
}
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index d2c9a68b..95ca396c 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -398,7 +398,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
} else {
if (view->container->parent) {
arrange_container(view->container->parent);
- } else {
+ } else if (view->container->workspace) {
arrange_workspace(view->container->workspace);
}
}
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 3619f202..a12ac854 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -394,7 +394,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
} else {
if (view->container->parent) {
arrange_container(view->container->parent);
- } else {
+ } else if (view->container->workspace) {
arrange_workspace(view->container->workspace);
}
}