diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-08-17 10:04:03 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 10:04:03 +1000 |
commit | 32193c7e4def7c0ba9cf8a7fcff02b1840d2b279 (patch) | |
tree | 83f8edec1482673a1ac26b02ea4bfcde014fed99 | |
parent | Merge pull request #2458 from RyanDwyer/cleanup-transactions (diff) | |
parent | When the workspace is focused, return it instead of checking parent (diff) | |
download | sway-32193c7e4def7c0ba9cf8a7fcff02b1840d2b279.tar.gz sway-32193c7e4def7c0ba9cf8a7fcff02b1840d2b279.tar.zst sway-32193c7e4def7c0ba9cf8a7fcff02b1840d2b279.zip |
Merge pull request #2465 from DonnieWest/master
Default to the previous workspace if the current one has no focused windows
-rw-r--r-- | sway/tree/workspace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index cd2a7a04..e7383de0 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -258,7 +258,8 @@ struct sway_container *workspace_by_name(const char *name) { | |||
258 | struct sway_container *current_workspace = NULL, *current_output = NULL; | 258 | struct sway_container *current_workspace = NULL, *current_output = NULL; |
259 | struct sway_container *focus = seat_get_focus(seat); | 259 | struct sway_container *focus = seat_get_focus(seat); |
260 | if (focus) { | 260 | if (focus) { |
261 | current_workspace = container_parent(focus, C_WORKSPACE); | 261 | current_workspace = focus->type == C_WORKSPACE ? |
262 | focus : container_parent(focus, C_WORKSPACE); | ||
262 | current_output = container_parent(focus, C_OUTPUT); | 263 | current_output = container_parent(focus, C_OUTPUT); |
263 | } | 264 | } |
264 | 265 | ||