From b585ad69b74542fbcd6a2784dc6f2af5ec8991e1 Mon Sep 17 00:00:00 2001 From: IoI_xD Date: Wed, 4 Mar 2026 20:44:25 -0700 Subject: [PATCH] code cleanup --- include/Mw/LowLevel/Cocoa.h | 1 - src/backend/cocoa.m | 19 +++++-------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/include/Mw/LowLevel/Cocoa.h b/include/Mw/LowLevel/Cocoa.h index 2659b3c..22bb29c 100644 --- a/include/Mw/LowLevel/Cocoa.h +++ b/include/Mw/LowLevel/Cocoa.h @@ -80,7 +80,6 @@ MilskoCocoaView *view; MwLL parent; MilskoFakePointer *handle; - MwBool doWHResize; } + (MilskoCocoa *)newWithParent:(MwLL)parent diff --git a/src/backend/cocoa.m b/src/backend/cocoa.m index 5d6f5c6..b9d1080 100644 --- a/src/backend/cocoa.m +++ b/src/backend/cocoa.m @@ -162,7 +162,7 @@ NSRect frame = [self->window frame]; *x = frame.origin.x; - *y = frame.origin.y; + *y = frame.origin.y - frame.size.height; *w = frame.size.width; *h = frame.size.height; @@ -175,11 +175,9 @@ if (self->parent) { NSWindow *parentWindow = [self parentWindow]; - CGFloat ny; - NSRect realFrame = parentWindow.frame; - NSRect correctedFrame = [parentWindow contentRectForFrameRect:realFrame]; - ny = (correctedFrame.size.height - y); - frame.origin.y = ny; + NSRect correctedFrame = + [parentWindow contentRectForFrameRect:parentWindow.frame]; + frame.origin.y = (correctedFrame.size.height - y); } [self->window setFrame:frame display:YES animate:false]; @@ -423,10 +421,6 @@ [self->window dealloc]; } -- (void)setDoWHResize:(MwBool)d { - doWHResize = d; -}; - - (NSWindow *)parentWindow { NSWindow *topmostWindow = self->window; while (topmostWindow.parentWindow) @@ -477,7 +471,6 @@ - (void)drawRect:(NSRect)dirtyRect { NSSize sz = [self->rep size]; - unsigned char *pixels; [super drawRect:dirtyRect]; if (!self->rep) { return; @@ -485,7 +478,7 @@ [self->rep drawInRect:NSMakeRect(0, 0, width, height)]; - pixels = [self->rep bitmapData]; + [self->rep bitmapData]; } - (void)destroy { @@ -507,8 +500,6 @@ @end @implementation MilskoFakePointer -- (void)viewDidMoveToSuperview { -} - (void)setPointer:(void *)pointer { self.frame = *(NSRect *)&pointer; self->ptr = pointer;