From f23588de3c7085830614f6764a5c0cd262538afd Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 8 Oct 2018 23:00:36 +1000 Subject: Introduce container_is_transient_for --- sway/tree/container.c | 7 +++++++ sway/tree/view.c | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'sway/tree') 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 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) { !container_is_fullscreen_or_child(view->container)) { // However, if we're transient for the fullscreen view and we allow // "popups" during fullscreen then it might be visible - bool is_transient = config->popup_during_fullscreen == POPUP_SMART && - workspace->fullscreen->view && - view_is_transient_for(view, workspace->fullscreen->view); - if (!is_transient) { + if (!container_is_transient_for(view->container, + workspace->fullscreen)) { return false; } } -- cgit v1.2.3