summaryrefslogtreecommitdiff
path: root/redo/window_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-18 15:16:41 -0400
committerPietro Gagliardi <[email protected]>2014-07-18 15:16:41 -0400
commitb56f60c04cb5128edce4894c5aaf8c04f721125b (patch)
treea275600af8540aa2a5bff450136a833945ba6efb /redo/window_darwin.m
parent6bc4425915920f0af935af02fe0eeebeae7e88b0 (diff)
Fixed control positioning on initial window show on Mac OS X.
Diffstat (limited to 'redo/window_darwin.m')
-rw-r--r--redo/window_darwin.m9
1 files changed, 8 insertions, 1 deletions
diff --git a/redo/window_darwin.m b/redo/window_darwin.m
index 426f353..20908c1 100644
--- a/redo/window_darwin.m
+++ b/redo/window_darwin.m
@@ -22,10 +22,15 @@
- (void)windowDidResize:(NSNotification *)n
{
+ [self doWindowResize:[n object]];
+}
+
+- (void)doWindowResize:(id)win
+{
NSWindow *w;
NSRect r;
- w = toNSWindow([n object]);
+ w = toNSWindow(win);
r = [[w contentView] frame];
windowResized(self->gowin, (uintptr_t) r.size.width, (uintptr_t) r.size.height);
}
@@ -62,6 +67,8 @@ void windowSetTitle(id win, const char * title)
void windowShow(id win)
{
[toNSWindow(win) makeKeyAndOrderFront:toNSWindow(win)];
+ // calling the above the first time won't emit a size changed event (unlike on Windows and GTK+), so fake one to get the controls laid out properly
+ [[toNSWindow(win) delegate] doWindowResize:win];
}
void windowHide(id win)