[gtk: 5/7] wayland: Add surface to toplevel list only if toplevel



commit 307cc69adb472bcdfeb1cafa01adf8948022f6f8
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Mar 17 15:28:14 2020 +0100

    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.

 gdk/wayland/gdksurface-wayland.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 9b18d19993..f910c8b9fd 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]