summaryrefslogtreecommitdiffstats
path: root/sway/tree/workspace.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-02-07 18:17:57 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-02-07 18:17:57 -0500
commita7d49da23956c245f0e6b8f7dc9cb532eb14c4b9 (patch)
tree83f3d132a16e69deb4dbbdb8b4f8d1cda5964c27 /sway/tree/workspace.c
parentmake index_child static (diff)
downloadsway-a7d49da23956c245f0e6b8f7dc9cb532eb14c4b9.tar.gz
sway-a7d49da23956c245f0e6b8f7dc9cb532eb14c4b9.tar.zst
sway-a7d49da23956c245f0e6b8f7dc9cb532eb14c4b9.zip
separate seat get focus and seat get focus inactive
Diffstat (limited to 'sway/tree/workspace.c')
-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) {
63swayc_t *workspace_by_name(const char *name) { 63swayc_t *workspace_by_name(const char *name) {
64 struct sway_seat *seat = input_manager_current_seat(input_manager); 64 struct sway_seat *seat = input_manager_current_seat(input_manager);
65 swayc_t *current_workspace = NULL, *current_output = NULL; 65 swayc_t *current_workspace = NULL, *current_output = NULL;
66 if (seat->has_focus) { 66 swayc_t *focus = sway_seat_get_focus(seat);
67 swayc_t *focus = sway_seat_get_focus(seat, &root_container); 67 if (focus) {
68 current_workspace = swayc_parent_by_type(focus, C_WORKSPACE); 68 current_workspace = swayc_parent_by_type(focus, C_WORKSPACE);
69 current_output = swayc_parent_by_type(focus, C_OUTPUT); 69 current_output = swayc_parent_by_type(focus, C_OUTPUT);
70 } 70 }
@@ -103,7 +103,7 @@ swayc_t *workspace_create(const char *name) {
103 } 103 }
104 // Otherwise create a new one 104 // Otherwise create a new one
105 struct sway_seat *seat = input_manager_current_seat(input_manager); 105 struct sway_seat *seat = input_manager_current_seat(input_manager);
106 swayc_t *focus = sway_seat_get_focus(seat, &root_container); 106 swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
107 parent = focus; 107 parent = focus;
108 parent = swayc_parent_by_type(parent, C_OUTPUT); 108 parent = swayc_parent_by_type(parent, C_OUTPUT);
109 return new_workspace(parent, name); 109 return new_workspace(parent, name);
@@ -195,7 +195,7 @@ bool workspace_switch(swayc_t *workspace) {
195 return false; 195 return false;
196 } 196 }
197 struct sway_seat *seat = input_manager_current_seat(input_manager); 197 struct sway_seat *seat = input_manager_current_seat(input_manager);
198 swayc_t *focus = sway_seat_get_focus(seat, &root_container); 198 swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
199 if (!seat || !focus) { 199 if (!seat || !focus) {
200 return false; 200 return false;
201 } 201 }