macos: Don't pass sizes to macos_surface_new()
authorBenjamin Otte <otte@redhat.com>
Tue, 18 Apr 2023 14:41:05 +0000 (16:41 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 26 Apr 2023 19:03:34 +0000 (21:03 +0200)
They're 0, 0, 100, 100 always, so just use those values everywhere.

gdk/macos/gdkmacosdisplay.c
gdk/macos/gdkmacospopupsurface-private.h
gdk/macos/gdkmacospopupsurface.c
gdk/macos/gdkmacossurface-private.h
gdk/macos/gdkmacossurface.c
gdk/macos/gdkmacostoplevelsurface-private.h
gdk/macos/gdkmacostoplevelsurface.c

index 9d52e04c29bddad7ac544a272c628551612437e6..5c81bd6eea3ac4be9a7e212d814e49f764f90f7d 100644 (file)
@@ -550,7 +550,7 @@ gdk_macos_display_create_surface (GdkDisplay     *display,
   g_assert (GDK_IS_MACOS_DISPLAY (self));
   g_assert (!parent || GDK_IS_MACOS_SURFACE (parent));
 
-  surface = _gdk_macos_surface_new (self, surface_type, parent, 0, 0, 100, 100);
+  surface = _gdk_macos_surface_new (self, surface_type, parent);
 
   if (surface != NULL)
     _gdk_macos_display_surface_added (self, surface);
index dfa6a77318e7c725944679f911cb5563322c928f..aa5b6a10972ee136616c78b78bab9e9b68ef4754 100644 (file)
@@ -33,11 +33,7 @@ typedef struct _GdkMacosPopupSurfaceClass GdkMacosPopupSurfaceClass;
 GType            _gdk_macos_popup_surface_get_type           (void);
 GdkMacosSurface *_gdk_macos_popup_surface_new                (GdkMacosDisplay      *display,
                                                               GdkSurface           *parent,
-                                                              GdkFrameClock        *frame_clock,
-                                                              int                   x,
-                                                              int                   y,
-                                                              int                   width,
-                                                              int                   height);
+                                                              GdkFrameClock        *frame_clock);
 void             _gdk_macos_popup_surface_attach_to_parent   (GdkMacosPopupSurface *self);
 void             _gdk_macos_popup_surface_detach_from_parent (GdkMacosPopupSurface *self);
 void             _gdk_macos_popup_surface_reposition         (GdkMacosPopupSurface *self);
index 061af9d85df66f02a376030d615414c4af7c0159..394f783e15ac5d1b43d8f6a6770376d211c3a6f2 100644 (file)
@@ -306,11 +306,7 @@ _gdk_macos_popup_surface_init (GdkMacosPopupSurface *self)
 GdkMacosSurface *
 _gdk_macos_popup_surface_new (GdkMacosDisplay *display,
                               GdkSurface      *parent,
-                              GdkFrameClock   *frame_clock,
-                              int              x,
-                              int              y,
-                              int              width,
-                              int              height)
+                              GdkFrameClock   *frame_clock)
 {
   GDK_BEGIN_MACOS_ALLOC_POOL;
 
@@ -329,13 +325,13 @@ _gdk_macos_popup_surface_new (GdkMacosDisplay *display,
 
   style_mask = NSWindowStyleMaskBorderless;
 
-  _gdk_macos_display_to_display_coords (display, x, y, &nx, &ny);
+  _gdk_macos_display_to_display_coords (display, 0, 0, &nx, &ny);
 
   screen = _gdk_macos_display_get_screen_at_display_coords (display, nx, ny);
   screen_rect = [screen frame];
   nx -= screen_rect.origin.x;
   ny -= screen_rect.origin.y;
-  content_rect = NSMakeRect (nx, ny - height, width, height);
+  content_rect = NSMakeRect (nx, ny - 100, 100, 100);
 
   window = [[GdkMacosWindow alloc] initWithContentRect:content_rect
                                              styleMask:style_mask
index fdd08f42490b4938eb00e8b711151da678be36b9..3c2e8f572c9d7782869c74cef3247ed76a7515f9 100644 (file)
@@ -86,11 +86,7 @@ struct _GdkMacosSurfaceClass
 
 GdkMacosSurface   *_gdk_macos_surface_new                     (GdkMacosDisplay      *display,
                                                                GdkSurfaceType        surface_type,
-                                                               GdkSurface           *parent,
-                                                               int                   x,
-                                                               int                   y,
-                                                               int                   width,
-                                                               int                   height);
+                                                               GdkSurface           *parent);
 NSWindow          *_gdk_macos_surface_get_native              (GdkMacosSurface      *self);
 CGDirectDisplayID  _gdk_macos_surface_get_screen_id           (GdkMacosSurface      *self);
 const char        *_gdk_macos_surface_get_title               (GdkMacosSurface      *self);
index 92e61d52f3d256eef0534564677923810bd9aab2..6da541e6cd871ba509abe790c6b4358ee5207683 100644 (file)
@@ -630,11 +630,11 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
   switch (surface_type)
     {
     case GDK_SURFACE_TOPLEVEL:
-      ret = _gdk_macos_toplevel_surface_new (display, frame_clock, x, y, width, height);
+      ret = _gdk_macos_toplevel_surface_new (display, frame_clock);
       break;
 
     case GDK_SURFACE_POPUP:
-      ret = _gdk_macos_popup_surface_new (display, parent, frame_clock, x, y, width, height);
+      ret = _gdk_macos_popup_surface_new (display, parent, frame_clock);
       break;
 
     case GDK_SURFACE_DRAG:
index fe9b6acc0734b38fc7880471db18b5ba1a4aaa7e..febec5550108c268d76971fe636db16dcec1432a 100644 (file)
@@ -45,12 +45,8 @@ struct _GdkMacosToplevelSurfaceClass
 };
 
 GType            _gdk_macos_toplevel_surface_get_type           (void);
-GdkMacosSurface *_gdk_macos_toplevel_surface_new                (GdkMacosDisplay *display,
-                                                                 GdkFrameClock   *frame_clock,
-                                                                 int              x,
-                                                                 int              y,
-                                                                 int              width,
-                                                                 int              height);
+GdkMacosSurface *_gdk_macos_toplevel_surface_new                (GdkMacosDisplay         *display,
+                                                                 GdkFrameClock           *frame_clock);
 void             _gdk_macos_toplevel_surface_attach_to_parent   (GdkMacosToplevelSurface *self);
 void             _gdk_macos_toplevel_surface_detach_from_parent (GdkMacosToplevelSurface *self);
 
index 8fbbfd42cb783a94b68dd792dffcac89ed2288af..7d4d943ea7a4915686da9690e19003b965a8f1f7 100644 (file)
@@ -650,11 +650,7 @@ _gdk_macos_toplevel_surface_init (GdkMacosToplevelSurface *self)
 
 GdkMacosSurface *
 _gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
-                                 GdkFrameClock   *frame_clock,
-                                 int              x,
-                                 int              y,
-                                 int              width,
-                                 int              height)
+                                 GdkFrameClock   *frame_clock)
 {
   GDK_BEGIN_MACOS_ALLOC_POOL;
 
@@ -675,11 +671,11 @@ _gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
                 NSWindowStyleMaskMiniaturizable |
                 NSWindowStyleMaskResizable);
 
-  _gdk_macos_display_to_display_coords (display, x, y + height, &nx, &ny);
+  _gdk_macos_display_to_display_coords (display, 0, 100, &nx, &ny);
 
   screen = _gdk_macos_display_get_screen_at_display_coords (display, nx, ny);
   visible_frame = [screen visibleFrame];
-  content_rect = NSMakeRect (nx - visible_frame.origin.x, ny - visible_frame.origin.y, width, height);
+  content_rect = NSMakeRect (nx - visible_frame.origin.x, ny - visible_frame.origin.y, 100, 100);
   window = [[GdkMacosWindow alloc] initWithContentRect:content_rect
                                              styleMask:style_mask
                                                backing:NSBackingStoreBuffered