diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-05-24 08:01:08 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-05-24 08:01:08 -0400 |
commit | 508f481fbb0cc8d079da9038e1599eec2cbb874d (patch) | |
tree | 27758bd899c6c6e78650ac6c0d6b3c1041a0962b | |
parent | Concatenate output cmd args, fixes #654 (diff) | |
parent | set focus on fullscreen view when changing focus (diff) | |
download | sway-508f481fbb0cc8d079da9038e1599eec2cbb874d.tar.gz sway-508f481fbb0cc8d079da9038e1599eec2cbb874d.tar.zst sway-508f481fbb0cc8d079da9038e1599eec2cbb874d.zip |
Merge pull request #671 from zandrmartin/fullscreen-focus
set focus on fullscreen view when changing focus
-rw-r--r-- | sway/focus.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/focus.c b/sway/focus.c index b4dfc423..9db2aaa7 100644 --- a/sway/focus.c +++ b/sway/focus.c | |||
@@ -88,7 +88,7 @@ swayc_t *get_focused_container(swayc_t *parent) { | |||
88 | if (!parent) { | 88 | if (!parent) { |
89 | return swayc_active_workspace(); | 89 | return swayc_active_workspace(); |
90 | } | 90 | } |
91 | // get focusde container | 91 | // get focused container |
92 | while (!parent->is_focused && parent->focused) { | 92 | while (!parent->is_focused && parent->focused) { |
93 | parent = parent->focused; | 93 | parent = parent->focused; |
94 | } | 94 | } |
@@ -112,7 +112,9 @@ bool set_focused_container(swayc_t *c) { | |||
112 | swayc_t *focused = get_focused_view(workspace); | 112 | swayc_t *focused = get_focused_view(workspace); |
113 | // if the workspace we are changing focus to has a fullscreen view return | 113 | // if the workspace we are changing focus to has a fullscreen view return |
114 | if (swayc_is_fullscreen(focused) && focused != c) { | 114 | if (swayc_is_fullscreen(focused) && focused != c) { |
115 | return false; | 115 | // if switching to a workspace with a fullscreen view, |
116 | // focus on the fullscreen view | ||
117 | c = focused; | ||
116 | } | 118 | } |
117 | 119 | ||
118 | // update container focus from here to root, making necessary changes along | 120 | // update container focus from here to root, making necessary changes along |
@@ -192,7 +194,7 @@ bool set_focused_container_for(swayc_t *a, swayc_t *c) { | |||
192 | return false; | 194 | return false; |
193 | } | 195 | } |
194 | 196 | ||
195 | // Check if we changing a parent container that will see chnage | 197 | // Check if we are changing a parent container that will see change |
196 | bool effective = true; | 198 | bool effective = true; |
197 | while (find != &root_container) { | 199 | while (find != &root_container) { |
198 | if (find->parent->focused != find) { | 200 | if (find->parent->focused != find) { |