From e6b91d3d7c9474ef067fafbd0f9724f6217a6d8b Mon Sep 17 00:00:00 2001 From: Hasen Judy Date: Tue, 6 Sep 2022 16:56:17 +0900 Subject: [PATCH] Remove the workaround for NSWindow initWithContentFrame Reverts #1841 Resolves #1825 --- vendor/darwin/Foundation/NSWindow.odin | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/vendor/darwin/Foundation/NSWindow.odin b/vendor/darwin/Foundation/NSWindow.odin index 330af6012..2efbe8ba3 100644 --- a/vendor/darwin/Foundation/NSWindow.odin +++ b/vendor/darwin/Foundation/NSWindow.odin @@ -103,18 +103,7 @@ Window_alloc :: proc() -> ^Window { @(objc_type=Window, objc_name="initWithContentRect") Window_initWithContentRect :: proc (self: ^Window, contentRect: Rect, styleMask: WindowStyleMask, backing: BackingStoreType, doDefer: bool) -> ^Window { - self := self - // HACK: due to a compiler bug, the generated calling code does not - // currently work for this message. Has to do with passing a struct along - // with other parameters, so we don't send the rect here. - // Omiting the rect argument here actually works, because of how the C - // calling conventions are defined. - self = msgSend(^Window, self, "initWithContentRect:styleMask:backing:defer:", styleMask, backing, doDefer) - - // apply the contentRect now, since we did not pass it to the init call - msgSend(nil, self, "setContentSize:", contentRect.size) - msgSend(nil, self, "setFrameOrigin:", contentRect.origin) - return self + return msgSend(^Window, self, "initWithContentRect:styleMask:backing:defer:", contentRect, styleMask, backing, doDefer) } @(objc_type=Window, objc_name="contentView") Window_contentView :: proc(self: ^Window) -> ^View {