wayland: Add surface to toplevel list only if toplevel

It was using another check (has parent) to do this, but now we have a
much more obvious way of creating surfaces, so we can use the type
directly.
This commit is contained in:
Jonas Ådahl 2020-03-17 15:28:14 +01:00
parent ab6b5ae568
commit 307cc69adb

View File

@ -700,6 +700,9 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
"display", display,
"frame-clock", frame_clock,
NULL);
display_wayland->toplevels = g_list_prepend (display_wayland->toplevels,
surface);
g_warn_if_fail (!parent);
break;
case GDK_SURFACE_POPUP:
surface = g_object_new (GDK_TYPE_WAYLAND_POPUP,
@ -746,9 +749,6 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
gdk_wayland_surface_set_title (surface, get_default_title ());
if (parent == NULL)
display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, surface);
impl->transient_for = parent;
gdk_wayland_surface_create_surface (surface);