aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar lbonn <bonnans.l@gmail.com>2021-01-20 22:20:00 +0100
committerLibravatar Tudor Brindus <me@tbrindus.ca>2021-02-25 09:40:20 -0500
commitc6e7cf1ae554f36e5120962ace779737827ad088 (patch)
tree6071546edfe33925f7f205414166e62fbfd6d819 /sway/tree/container.c
parentAutomatically map built-in touchscreens/tablets to built-in panels (diff)
downloadsway-c6e7cf1ae554f36e5120962ace779737827ad088.tar.gz
sway-c6e7cf1ae554f36e5120962ace779737827ad088.tar.zst
sway-c6e7cf1ae554f36e5120962ace779737827ad088.zip
focus: beyond fullscreen when focused explicitly
When issuing a focus command on a specific container, users expect to proceed it even if is hidden by a fullscreen window. This matches the behavior of i3.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 6b4c6de2..e22c5961 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -418,6 +418,28 @@ void container_for_each_child(struct sway_container *container,
418 } 418 }
419} 419}
420 420
421struct sway_container *container_obstructing_fullscreen_container(struct sway_container *container)
422{
423 struct sway_workspace *workspace = container->pending.workspace;
424
425 if (workspace && workspace->fullscreen && !container_is_fullscreen_or_child(container)) {
426 if (container_is_transient_for(container, workspace->fullscreen)) {
427 return NULL;
428 }
429 return workspace->fullscreen;
430 }
431
432 struct sway_container *fullscreen_global = root->fullscreen_global;
433 if (fullscreen_global && container != fullscreen_global && !container_has_ancestor(container, fullscreen_global)) {
434 if (container_is_transient_for(container, fullscreen_global)) {
435 return NULL;
436 }
437 return fullscreen_global;
438 }
439
440 return NULL;
441}
442
421bool container_has_ancestor(struct sway_container *descendant, 443bool container_has_ancestor(struct sway_container *descendant,
422 struct sway_container *ancestor) { 444 struct sway_container *ancestor) {
423 while (descendant) { 445 while (descendant) {