aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c7
-rw-r--r--sway/tree/view.c23
2 files changed, 29 insertions, 1 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,
return cont;
}
+
+bool container_is_transient_for(struct sway_container *child,
+ struct sway_container *ancestor) {
+ return config->popup_during_fullscreen == POPUP_SMART &&
+ child->view && ancestor->view &&
+ view_is_transient_for(child->view, ancestor->view);
+}
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 73ce55ac..97525d6b 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -575,6 +575,16 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
view_set_tiled(view, true);
}
+ if (config->popup_during_fullscreen == POPUP_LEAVE &&
+ view->container->workspace &&
+ view->container->workspace->fullscreen &&
+ view->container->workspace->fullscreen->view) {
+ struct sway_container *fs = view->container->workspace->fullscreen;
+ if (view_is_transient_for(view, fs->view)) {
+ container_set_fullscreen(fs, false);
+ }
+ }
+
if (should_focus(view)) {
input_manager_set_focus(input_manager, &view->container->node);
}
@@ -1042,7 +1052,12 @@ bool view_is_visible(struct sway_view *view) {
// Check view isn't hidden by another fullscreen view
if (workspace->fullscreen &&
!container_is_fullscreen_or_child(view->container)) {
- return false;
+ // However, if we're transient for the fullscreen view and we allow
+ // "popups" during fullscreen then it might be visible
+ if (!container_is_transient_for(view->container,
+ workspace->fullscreen)) {
+ return false;
+ }
}
return true;
}
@@ -1095,3 +1110,9 @@ void view_save_buffer(struct sway_view *view) {
view->saved_buffer_height = view->surface->current.height;
}
}
+
+bool view_is_transient_for(struct sway_view *child,
+ struct sway_view *ancestor) {
+ return child->impl->is_transient_for &&
+ child->impl->is_transient_for(child, ancestor);
+}