[gtk/wip/chergert/quartz4u: 100/146] macos: set initial surface size during construction
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/quartz4u: 100/146] macos: set initial surface size during construction
- Date: Fri, 19 Jun 2020 18:17:12 +0000 (UTC)
commit 94893d5289d01a990c23eae1c29356c439676685
Author: Christian Hergert <chergert redhat com>
Date: Wed May 20 14:49:22 2020 -0700
macos: set initial surface size during construction
Or we risk resizing windows to their smallest sizes during
gtk_native_check_resize().
gdk/macos/gdkmacossurface.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c
index 86b363938f..f1063cdf13 100644
--- a/gdk/macos/gdkmacossurface.c
+++ b/gdk/macos/gdkmacossurface.c
@@ -296,6 +296,15 @@ gdk_macos_surface_constructed (GObject *object)
G_OBJECT_CLASS (gdk_macos_surface_parent_class)->constructed (object);
+ if (self->window != NULL)
+ {
+ NSRect bounds = [[self->window contentView] bounds];
+
+ GDK_SURFACE (self)->width = bounds.size.width;
+ GDK_SURFACE (self)->height = bounds.size.height;
+ _gdk_macos_surface_update_position (self);
+ }
+
if ((frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self))))
{
g_signal_connect_object (frame_clock,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]