macos: Move construction stuff into ::constructed
authorBenjamin Otte <otte@redhat.com>
Tue, 18 Apr 2023 14:37:43 +0000 (16:37 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 26 Apr 2023 19:03:34 +0000 (21:03 +0200)
gdk/macos/gdkmacossurface.c

index dc4375730c16896ff31f4a3e0989aae7564f9782..1c2008a521330033f01fe86a7193f4ab4b2d60c3 100644 (file)
@@ -527,6 +527,9 @@ gdk_macos_surface_constructed (GObject *object)
                                G_CONNECT_SWAPPED);
     }
 
+  gdk_surface_freeze_updates (GDK_SURFACE (self));
+  _gdk_macos_surface_monitor_changed (self);
+
   if (self->window != NULL)
     _gdk_macos_surface_configure (self);
 }
@@ -612,13 +615,9 @@ gdk_macos_surface_init (GdkMacosSurface *self)
 }
 
 GdkMacosSurface *
-_gdk_macos_surface_new (GdkMacosDisplay   *display,
-                        GdkSurfaceType     surface_type,
-                        GdkSurface        *parent,
-                        int                x,
-                        int                y,
-                        int                width,
-                        int                height)
+_gdk_macos_surface_new (GdkMacosDisplay *display,
+                        GdkSurfaceType   surface_type,
+                        GdkSurface      *parent)
 {
   GdkFrameClock *frame_clock;
   GdkMacosSurface *ret;
@@ -649,12 +648,6 @@ _gdk_macos_surface_new (GdkMacosDisplay   *display,
       ret = NULL;
     }
 
-  if (ret != NULL)
-    {
-      gdk_surface_freeze_updates (GDK_SURFACE (ret));
-      _gdk_macos_surface_monitor_changed (ret);
-    }
-
   g_object_unref (frame_clock);
 
   return g_steal_pointer (&ret);