Skip to content

Commit e5e89cb

Browse files
author
Trent Gamblin
committed
OS X window changes:
- clear window to black when going in/out of fullscreen. this remotes the "animated" flag but all that seemed to do was cause a white flash - center the window using [NSWindow center] instead of calculated position. This centers it more accurately and matches the position when going out of FULLSCREEN_WINDOW mode.
1 parent 57e0d81 commit e5e89cb

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/macosx/osxgl.m

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ +(void) set_frame : (NSValue *) param {
267267
NSRect *rc = [[array objectAtIndex:0] pointerValue];
268268
NSWindow *win = [[array objectAtIndex:1] pointerValue];
269269

270-
// Couldn't resist animating it!
271-
[win setFrame:*rc display:YES animate:YES];
270+
[win setFrame:*rc display:YES animate:NO];
272271
}
273272
@end
274273

@@ -1033,14 +1032,7 @@ +(void) initialiseDisplay: (NSValue*) display_object {
10331032
[win setFrameOrigin: origin];
10341033
}
10351034
else {
1036-
/* Center the window */
1037-
NSRect rc = [win frame];
1038-
NSRect sc = [[win screen] frame];
1039-
NSPoint origin;
1040-
1041-
origin.x = sc.origin.x + sc.size.width/2 - rc.size.width/2;
1042-
origin.y = sc.origin.y + sc.size.height/2 - rc.size.height/2;
1043-
[win setFrameOrigin: origin];
1035+
[win center];
10441036
}
10451037
[win makeKeyAndOrderFront:self];
10461038
if (mask != NSBorderlessWindowMask) [win makeMainWindow];
@@ -1974,6 +1966,9 @@ static bool resize_display_win(ALLEGRO_DISPLAY *d, int w, int h)
19741966
waitUntilDone: YES];
19751967

19761968
[pool drain];
1969+
1970+
clear_to_black(dpy->ctx);
1971+
19771972
return acknowledge_resize_display_win(d);
19781973
}
19791974

0 commit comments

Comments
 (0)