From 832ebc896655cb5ca7689559d4e42b426d764e71 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 7 Oct 2018 20:40:05 +1000 Subject: 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. --- sway/input/seat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sway/input/seat.c') diff --git a/sway/input/seat.c b/sway/input/seat.c index f5cb2f9e..690b59e6 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -655,7 +655,14 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, // Deny setting focus to a view which is hidden by a fullscreen container if (new_workspace && new_workspace->fullscreen && container && !container_is_fullscreen_or_child(container)) { - return; + // Unless it's a transient container + bool is_transient = new_workspace->fullscreen->view && + config->popup_during_fullscreen == POPUP_SMART && + container->view && view_is_transient_for( + container->view, new_workspace->fullscreen->view); + if (!is_transient) { + return; + } } struct sway_output *last_output = last_workspace ? -- cgit v1.2.3 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/input/seat.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sway/input/seat.c') diff --git a/sway/input/seat.c b/sway/input/seat.c index 690b59e6..f418785d 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -656,11 +656,7 @@ void seat_set_focus_warp(struct sway_seat *seat, struct sway_node *node, if (new_workspace && new_workspace->fullscreen && container && !container_is_fullscreen_or_child(container)) { // Unless it's a transient container - bool is_transient = new_workspace->fullscreen->view && - config->popup_during_fullscreen == POPUP_SMART && - container->view && view_is_transient_for( - container->view, new_workspace->fullscreen->view); - if (!is_transient) { + if (!container_is_transient_for(container, new_workspace->fullscreen)) { return; } } -- cgit v1.2.3