aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.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/desktop/xdg_shell_v6.c
parenta03955f9368cfa1c190e4194eed8437dce22eb77 (diff)
parent3f328b62768d7801f0544b31ab8f9dde3014fd1d (diff)
downloadsway-a999269e1cf8eeb423547a0c8ab3420f27628168.tar.xz
Merge pull request #2782 from RyanDwyer/popup-during-fullscreen
Implement popup_during_fullscreen
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index a7838c0f..ff950c70 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -189,6 +189,21 @@ static void for_each_popup(struct sway_view *view,
user_data);
}
+static bool is_transient_for(struct sway_view *child,
+ struct sway_view *ancestor) {
+ if (xdg_shell_v6_view_from_view(child) == NULL) {
+ return false;
+ }
+ struct wlr_xdg_surface_v6 *surface = child->wlr_xdg_surface_v6;
+ while (surface) {
+ if (surface->toplevel->parent == ancestor->wlr_xdg_surface_v6) {
+ return true;
+ }
+ surface = surface->toplevel->parent;
+ }
+ return false;
+}
+
static void _close(struct sway_view *view) {
if (xdg_shell_v6_view_from_view(view) == NULL) {
return;
@@ -230,6 +245,7 @@ static const struct sway_view_impl view_impl = {
.wants_floating = wants_floating,
.for_each_surface = for_each_surface,
.for_each_popup = for_each_popup,
+ .is_transient_for = is_transient_for,
.close = _close,
.close_popups = close_popups,
.destroy = destroy,