diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-08 23:00:36 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-08 23:00:36 +1000 |
commit | f23588de3c7085830614f6764a5c0cd262538afd (patch) | |
tree | 6460aecbaf206dffcc4ffb546c4a8143025b82db /sway/tree | |
parent | Implement popup_during_fullscreen (diff) | |
download | sway-f23588de3c7085830614f6764a5c0cd262538afd.tar.gz sway-f23588de3c7085830614f6764a5c0cd262538afd.tar.zst sway-f23588de3c7085830614f6764a5c0cd262538afd.zip |
Introduce container_is_transient_for
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 7 | ||||
-rw-r--r-- | sway/tree/view.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 9db7aed1..1664514a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -1212,3 +1212,10 @@ struct sway_container *container_split(struct sway_container *child, | |||
1212 | 1212 | ||
1213 | return cont; | 1213 | return cont; |
1214 | } | 1214 | } |
1215 | |||
1216 | bool container_is_transient_for(struct sway_container *child, | ||
1217 | struct sway_container *ancestor) { | ||
1218 | return config->popup_during_fullscreen == POPUP_SMART && | ||
1219 | child->view && ancestor->view && | ||
1220 | view_is_transient_for(child->view, ancestor->view); | ||
1221 | } | ||
diff --git a/sway/tree/view.c b/sway/tree/view.c index edf771c1..b107d871 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -1044,10 +1044,8 @@ bool view_is_visible(struct sway_view *view) { | |||
1044 | !container_is_fullscreen_or_child(view->container)) { | 1044 | !container_is_fullscreen_or_child(view->container)) { |
1045 | // However, if we're transient for the fullscreen view and we allow | 1045 | // However, if we're transient for the fullscreen view and we allow |
1046 | // "popups" during fullscreen then it might be visible | 1046 | // "popups" during fullscreen then it might be visible |
1047 | bool is_transient = config->popup_during_fullscreen == POPUP_SMART && | 1047 | if (!container_is_transient_for(view->container, |
1048 | workspace->fullscreen->view && | 1048 | workspace->fullscreen)) { |
1049 | view_is_transient_for(view, workspace->fullscreen->view); | ||
1050 | if (!is_transient) { | ||
1051 | return false; | 1049 | return false; |
1052 | } | 1050 | } |
1053 | } | 1051 | } |