aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-05-24 08:01:08 -0400
committerDrew DeVault <sir@cmpwn.com>2016-05-24 08:01:08 -0400
commit508f481fbb0cc8d079da9038e1599eec2cbb874d (patch)
tree27758bd899c6c6e78650ac6c0d6b3c1041a0962b
parent16dc31f33b201e949f912f993ef927c72a307b88 (diff)
parent164f384d835665ca2c63f712a4fe00ab22b43d9b (diff)
downloadsway-508f481fbb0cc8d079da9038e1599eec2cbb874d.tar.xz
Merge pull request #671 from zandrmartin/fullscreen-focus
set focus on fullscreen view when changing focus
-rw-r--r--sway/focus.c8
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) {
if (!parent) {
return swayc_active_workspace();
}
- // get focusde container
+ // get focused container
while (!parent->is_focused && parent->focused) {
parent = parent->focused;
}
@@ -112,7 +112,9 @@ bool set_focused_container(swayc_t *c) {
swayc_t *focused = get_focused_view(workspace);
// if the workspace we are changing focus to has a fullscreen view return
if (swayc_is_fullscreen(focused) && focused != c) {
- return false;
+ // if switching to a workspace with a fullscreen view,
+ // focus on the fullscreen view
+ c = focused;
}
// 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) {
return false;
}
- // Check if we changing a parent container that will see chnage
+ // Check if we are changing a parent container that will see change
bool effective = true;
while (find != &root_container) {
if (find->parent->focused != find) {