mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 21:14:10 +01:00
Merge pull request #2465 from DonnieWest/master
Default to the previous workspace if the current one has no focused windows
This commit is contained in:
commit
32193c7e4d
@ -258,7 +258,8 @@ struct sway_container *workspace_by_name(const char *name) {
|
|||||||
struct sway_container *current_workspace = NULL, *current_output = NULL;
|
struct sway_container *current_workspace = NULL, *current_output = NULL;
|
||||||
struct sway_container *focus = seat_get_focus(seat);
|
struct sway_container *focus = seat_get_focus(seat);
|
||||||
if (focus) {
|
if (focus) {
|
||||||
current_workspace = container_parent(focus, C_WORKSPACE);
|
current_workspace = focus->type == C_WORKSPACE ?
|
||||||
|
focus : container_parent(focus, C_WORKSPACE);
|
||||||
current_output = container_parent(focus, C_OUTPUT);
|
current_output = container_parent(focus, C_OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user