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.
This commit is contained in:
Alexander Larsson 2020-03-13 14:35:43 +01:00
parent 03d6d272f7
commit b74a26b275

View File

@ -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;