diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-07 20:40:05 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-08 22:49:59 +1000 |
commit | 832ebc896655cb5ca7689559d4e42b426d764e71 (patch) | |
tree | 1a3bc3ff7fb13d7ed5e86ad67a05739d4c4a1de3 /sway/tree/view.c | |
parent | Merge pull request #2791 from RyanDwyer/status-command-optional (diff) | |
download | sway-832ebc896655cb5ca7689559d4e42b426d764e71.tar.gz sway-832ebc896655cb5ca7689559d4e42b426d764e71.tar.zst sway-832ebc896655cb5ca7689559d4e42b426d764e71.zip |
Implement popup_during_fullscreen
This introduces a new view_impl function: is_transient_for. Similar to
container_has_ancestor but works using the surface parents rather than
the tree.
This patch modifies view_is_visible, container_at and so on to allow
transient views to function normally when they're in front of a
fullscreen view.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 73ce55ac..edf771c1 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -1042,7 +1042,14 @@ bool view_is_visible(struct sway_view *view) { | |||
1042 | // Check view isn't hidden by another fullscreen view | 1042 | // Check view isn't hidden by another fullscreen view |
1043 | if (workspace->fullscreen && | 1043 | if (workspace->fullscreen && |
1044 | !container_is_fullscreen_or_child(view->container)) { | 1044 | !container_is_fullscreen_or_child(view->container)) { |
1045 | return false; | 1045 | // However, if we're transient for the fullscreen view and we allow |
1046 | // "popups" during fullscreen then it might be visible | ||
1047 | bool is_transient = config->popup_during_fullscreen == POPUP_SMART && | ||
1048 | workspace->fullscreen->view && | ||
1049 | view_is_transient_for(view, workspace->fullscreen->view); | ||
1050 | if (!is_transient) { | ||
1051 | return false; | ||
1052 | } | ||
1046 | } | 1053 | } |
1047 | return true; | 1054 | return true; |
1048 | } | 1055 | } |
@@ -1095,3 +1102,9 @@ void view_save_buffer(struct sway_view *view) { | |||
1095 | view->saved_buffer_height = view->surface->current.height; | 1102 | view->saved_buffer_height = view->surface->current.height; |
1096 | } | 1103 | } |
1097 | } | 1104 | } |
1105 | |||
1106 | bool view_is_transient_for(struct sway_view *child, | ||
1107 | struct sway_view *ancestor) { | ||
1108 | return child->impl->is_transient_for && | ||
1109 | child->impl->is_transient_for(child, ancestor); | ||
1110 | } | ||