summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2020-03-13 14:35:43 +0100
committerAlexander Larsson <alexl@redhat.com>2020-03-13 15:06:02 +0100
commitb74a26b275819719a5f8b71ed0f9cc30236eb4c0 (patch)
tree3eeee04fcad8dcf08b27f794eb1c2087c25dff43 /gdk
parent03d6d272f79fde6a0dc2583ab4f105969d227599 (diff)
downloadgtk+-b74a26b275819719a5f8b71ed0f9cc30236eb4c0.tar.gz
broadway: Keep popups above their parent
We set the parent as a "transient parent" for popups, which means they will not be stacked below the parent.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/broadway/gdksurface-broadway.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index bb3acf2f98..9dcf3f14f1 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -273,6 +273,13 @@ _gdk_broadway_display_create_surface (GdkDisplay *display,
connect_frame_clock (surface);
+ /* We treat the real parent as a default transient for to get stacking right */
+ if (parent)
+ {
+ impl->transient_for = GDK_BROADWAY_SURFACE (parent)->id;
+ _gdk_broadway_server_surface_set_transient_for (broadway_display->server, impl->id, impl->transient_for);
+ }
+
return surface;
}
@@ -670,6 +677,10 @@ gdk_broadway_surface_set_transient_for (GdkSurface *surface,
impl = GDK_BROADWAY_SURFACE (surface);
+ /* We treat the real parent as a default transient for to get stacking right */
+ if (parent == NULL)
+ parent = surface->parent;
+
parent_id = 0;
if (parent)
parent_id = GDK_BROADWAY_SURFACE (parent)->id;