diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-13 08:18:12 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-13 08:18:12 -0500 |
commit | 2f89b7084de2ba97bf9369376ab341f715b47c1a (patch) | |
tree | fe4a17c9277a3c2b2491682bd9312d67fd63f1a7 | |
parent | Track the fullscreen view on a workspace swayc_t (diff) | |
download | sway-2f89b7084de2ba97bf9369376ab341f715b47c1a.tar.gz sway-2f89b7084de2ba97bf9369376ab341f715b47c1a.tar.zst sway-2f89b7084de2ba97bf9369376ab341f715b47c1a.zip |
Correctly handle moving between fullscreen views
If focus would move in an output with a fullscreen view, it always
leaves the output. If focus would enter an output with a fullscreen
view, it always focuses the fullscreened view.
-rw-r--r-- | sway/layout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index e89402ed..333c1928 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -579,6 +579,19 @@ swayc_t *get_swayc_in_direction_under(swayc_t *container, enum movement_directio | |||
579 | // output might border to multiple outputs). | 579 | // output might border to multiple outputs). |
580 | struct wlc_point abs_pos; | 580 | struct wlc_point abs_pos; |
581 | get_absolute_center_position(container, &abs_pos); | 581 | get_absolute_center_position(container, &abs_pos); |
582 | |||
583 | if (container->type == C_VIEW && swayc_is_fullscreen(container)) { | ||
584 | sway_log(L_DEBUG, "Moving from fullscreen view, skipping to output"); | ||
585 | container = swayc_parent_by_type(container, C_OUTPUT); | ||
586 | get_absolute_center_position(container, &abs_pos); | ||
587 | return swayc_adjacent_output(container, dir, &abs_pos, true); | ||
588 | } | ||
589 | |||
590 | if (container->type == C_WORKSPACE && container->fullscreen) { | ||
591 | sway_log(L_DEBUG, "Moving to fullscreen view"); | ||
592 | return container->fullscreen; | ||
593 | } | ||
594 | |||
582 | while (true) { | 595 | while (true) { |
583 | // Test if we can even make a difference here | 596 | // Test if we can even make a difference here |
584 | bool can_move = false; | 597 | bool can_move = false; |