mirror of https://github.com/xemu-project/xemu.git
ui/cocoa: Remove the uses of full screen APIs
The detections of [NSView -enterFullScreen:] and [NSView -exitFullScreen:] were wrong. A detection is coded as: [NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)] but it should be: [NSView instancesRespondToSelector:@selector(exitFullScreenModeWithOptions:)] Because of those APIs were not detected, ui/cocoa always falled back to a borderless window whose frame matches the screen to implement fullscreen behavior. The code using [NSView -enterFullScreen:] and [NSView -exitFullScreen:] will be used if you fix the detections, but its behavior is undesirable; the full screen view stretches the video, changing the aspect ratio, even if zooming is disabled. This change removes the code as it does nothing good. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Message-Id: <20210220013138.51437-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
cbcf09872a
commit
1e8b6f2b49
11
ui/cocoa.m
11
ui/cocoa.m
|
@ -585,25 +585,15 @@ QemuCocoaView *cocoaView;
|
|||
isFullscreen = FALSE;
|
||||
[self ungrabMouse];
|
||||
[self setContentDimensions];
|
||||
if ([NSView respondsToSelector:@selector(exitFullScreenModeWithOptions:)]) { // test if "exitFullScreenModeWithOptions" is supported on host at runtime
|
||||
[self exitFullScreenModeWithOptions:nil];
|
||||
} else {
|
||||
[fullScreenWindow close];
|
||||
[normalWindow setContentView: self];
|
||||
[normalWindow makeKeyAndOrderFront: self];
|
||||
[NSMenu setMenuBarVisible:YES];
|
||||
}
|
||||
} else { // switch from desktop to fullscreen
|
||||
isFullscreen = TRUE;
|
||||
[normalWindow orderOut: nil]; /* Hide the window */
|
||||
[self grabMouse];
|
||||
[self setContentDimensions];
|
||||
if ([NSView respondsToSelector:@selector(enterFullScreenMode:withOptions:)]) { // test if "enterFullScreenMode:withOptions" is supported on host at runtime
|
||||
[self enterFullScreenMode:[NSScreen mainScreen] withOptions:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens,
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], kCGDisplayModeIsStretched, nil], NSFullScreenModeSetting,
|
||||
nil]];
|
||||
} else {
|
||||
[NSMenu setMenuBarVisible:NO];
|
||||
fullScreenWindow = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
|
||||
styleMask:NSWindowStyleMaskBorderless
|
||||
|
@ -617,7 +607,6 @@ QemuCocoaView *cocoaView;
|
|||
[fullScreenWindow makeKeyAndOrderFront:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) toggleModifier: (int)keycode {
|
||||
// Toggle the stored state.
|
||||
|
|
Loading…
Reference in New Issue