macos: Add surface from ::constructed()

This commit is contained in:
Benjamin Otte 2023-04-21 21:59:31 +02:00
parent cb642bec25
commit f2083d36a1
5 changed files with 9 additions and 9 deletions

View File

@ -121,6 +121,8 @@ GdkMonitor *_gdk_macos_display_get_monitor_at_coords (GdkMacosDisp
GdkMonitor *_gdk_macos_display_get_monitor_at_display_coords (GdkMacosDisplay *self,
int x,
int y);
void _gdk_macos_display_surface_added (GdkMacosDisplay *self,
GdkMacosSurface *surface);
GdkEvent *_gdk_macos_display_translate (GdkMacosDisplay *self,
NSEvent *event);
void _gdk_macos_display_feedback_init (GdkMacosDisplay *self);

View File

@ -333,7 +333,7 @@ gdk_macos_display_queue_events (GdkDisplay *display)
}
}
static void
void
_gdk_macos_display_surface_added (GdkMacosDisplay *self,
GdkMacosSurface *surface)
{
@ -552,9 +552,6 @@ gdk_macos_display_create_surface (GdkDisplay *display,
surface = _gdk_macos_surface_new (self, surface_type, parent);
if (surface != NULL)
_gdk_macos_display_surface_added (self, surface);
return GDK_SURFACE (surface);
}

View File

@ -71,7 +71,7 @@ _gdk_macos_drag_surface_constructed (GObject *object)
GdkMacosWindow *window;
GdkMacosSurface *self = GDK_MACOS_SURFACE (object);
GdkSurface *surface = GDK_SURFACE (self);
GdkDisplay *display = gdk_surface_get_display (GDK_SURFACE (self));
GdkMacosDisplay *display = GDK_MACOS_DISPLAY (gdk_surface_get_display (GDK_SURFACE (self)));
GdkFrameClock *frame_clock;
NSScreen *screen;
NSUInteger style_mask;
@ -129,9 +129,7 @@ _gdk_macos_drag_surface_new (GdkMacosDisplay *display)
{
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
self = g_object_new (GDK_TYPE_MACOS_DRAG_SURFACE,
return g_object_new (GDK_TYPE_MACOS_DRAG_SURFACE,
"display", display,
NULL);
return g_steal_pointer (&self);
}

View File

@ -291,7 +291,7 @@ _gdk_macos_popup_surface_constructed (GObject *object)
GdkMacosWindow *window;
GdkMacosPopupSurface *self = GDK_MACOS_POPUP_SURFACE (object);
GdkSurface *surface = GDK_SURFACE (self);
GdkDisplay *display = gdk_surface_get_display (GDK_SURFACE (self));
GdkMacosDisplay *display = GDK_MACOS_DISPLAY (gdk_surface_get_display (GDK_SURFACE (self)));
NSScreen *screen;
NSUInteger style_mask;
NSRect content_rect;

View File

@ -522,6 +522,9 @@ gdk_macos_surface_constructed (GObject *object)
if (self->window != NULL)
_gdk_macos_surface_configure (self);
_gdk_macos_display_surface_added (GDK_MACOS_DISPLAY (gdk_surface_get_display (GDK_SURFACE (self))),
self);
}
static void