mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 14:43:50 -04:00
cocoa: Exit macOS' fullscreen mode when switching fullscreen
Prevents black screen when switching to fullscreen
This commit is contained in:
parent
82b9a1266c
commit
c7bcec1ff5
@ -1475,6 +1475,11 @@ do_switch_fullscreen(CFDictionaryRef mode) {
|
||||
}
|
||||
|
||||
if (_window != nil) {
|
||||
// Exit macOS' own fullscreen mode, since our own fullscreen mode
|
||||
// doesn't work properly with it.
|
||||
if ([_window styleMask] & NSFullScreenWindowMask) {
|
||||
[_window toggleFullScreen:nil];
|
||||
}
|
||||
[_window setFrame:frame display:YES];
|
||||
[_view setFrame:NSMakeRect(0, 0, frame.size.width, frame.size.height)];
|
||||
[_window update];
|
||||
|
Loading…
x
Reference in New Issue
Block a user