aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/workspace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c
index ce5b425c..29f07f74 100644
--- a/sway/tree/workspace.c
+++ b/sway/tree/workspace.c
@@ -63,8 +63,8 @@ static bool _workspace_by_name(swayc_t *view, void *data) {
swayc_t *workspace_by_name(const char *name) {
struct sway_seat *seat = input_manager_current_seat(input_manager);
swayc_t *current_workspace = NULL, *current_output = NULL;
- if (seat->has_focus) {
- swayc_t *focus = sway_seat_get_focus(seat, &root_container);
+ swayc_t *focus = sway_seat_get_focus(seat);
+ if (focus) {
current_workspace = swayc_parent_by_type(focus, C_WORKSPACE);
current_output = swayc_parent_by_type(focus, C_OUTPUT);
}
@@ -103,7 +103,7 @@ swayc_t *workspace_create(const char *name) {
}
// Otherwise create a new one
struct sway_seat *seat = input_manager_current_seat(input_manager);
- swayc_t *focus = sway_seat_get_focus(seat, &root_container);
+ swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
parent = focus;
parent = swayc_parent_by_type(parent, C_OUTPUT);
return new_workspace(parent, name);
@@ -195,7 +195,7 @@ bool workspace_switch(swayc_t *workspace) {
return false;
}
struct sway_seat *seat = input_manager_current_seat(input_manager);
- swayc_t *focus = sway_seat_get_focus(seat, &root_container);
+ swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
if (!seat || !focus) {
return false;
}