From: Benjamin Otte Date: Tue, 18 Apr 2023 14:41:05 +0000 (+0200) Subject: macos: Don't pass sizes to macos_surface_new() X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~368^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7e18a1cea7b265703dfdbe779559c3c65e9092c3;p=gtk4.git macos: Don't pass sizes to macos_surface_new() They're 0, 0, 100, 100 always, so just use those values everywhere. --- diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c index 9d52e04c29..5c81bd6eea 100644 --- a/gdk/macos/gdkmacosdisplay.c +++ b/gdk/macos/gdkmacosdisplay.c @@ -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); diff --git a/gdk/macos/gdkmacospopupsurface-private.h b/gdk/macos/gdkmacospopupsurface-private.h index dfa6a77318..aa5b6a1097 100644 --- a/gdk/macos/gdkmacospopupsurface-private.h +++ b/gdk/macos/gdkmacospopupsurface-private.h @@ -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); diff --git a/gdk/macos/gdkmacospopupsurface.c b/gdk/macos/gdkmacospopupsurface.c index 061af9d85d..394f783e15 100644 --- a/gdk/macos/gdkmacospopupsurface.c +++ b/gdk/macos/gdkmacospopupsurface.c @@ -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 diff --git a/gdk/macos/gdkmacossurface-private.h b/gdk/macos/gdkmacossurface-private.h index fdd08f4249..3c2e8f572c 100644 --- a/gdk/macos/gdkmacossurface-private.h +++ b/gdk/macos/gdkmacossurface-private.h @@ -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); diff --git a/gdk/macos/gdkmacossurface.c b/gdk/macos/gdkmacossurface.c index 92e61d52f3..6da541e6cd 100644 --- a/gdk/macos/gdkmacossurface.c +++ b/gdk/macos/gdkmacossurface.c @@ -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: diff --git a/gdk/macos/gdkmacostoplevelsurface-private.h b/gdk/macos/gdkmacostoplevelsurface-private.h index fe9b6acc07..febec55501 100644 --- a/gdk/macos/gdkmacostoplevelsurface-private.h +++ b/gdk/macos/gdkmacostoplevelsurface-private.h @@ -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); diff --git a/gdk/macos/gdkmacostoplevelsurface.c b/gdk/macos/gdkmacostoplevelsurface.c index 8fbbfd42cb..7d4d943ea7 100644 --- a/gdk/macos/gdkmacostoplevelsurface.c +++ b/gdk/macos/gdkmacostoplevelsurface.c @@ -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