aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-10-08 15:28:09 -0400
committerGitHub <noreply@github.com>2018-10-08 15:28:09 -0400
commita999269e1cf8eeb423547a0c8ab3420f27628168 (patch)
tree3572a9e1bff58710c22638d85ce1206af3999d94 /sway/tree/view.c
parenta03955f9368cfa1c190e4194eed8437dce22eb77 (diff)
parent3f328b62768d7801f0544b31ab8f9dde3014fd1d (diff)
Merge pull request #2782 from RyanDwyer/popup-during-fullscreen
Implement popup_during_fullscreen
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c23
1 files changed, 22 insertions, 1 deletions
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);
+}