qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fixes fullscreen aspect ratio and leaving fulls


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] Fixes fullscreen aspect ratio and leaving fullscreen mode problem on Mac OS X
Date: Thu, 1 Jan 2015 14:55:40 +0000

On 30 December 2014 at 04:17, Programmingkid <address@hidden> wrote:
> This patch fixes these problems for QEMU on Mac OS X:
> - fullscreen mode not having the correct aspect ratio

What is the bug being fixed here? For me on 10.9.5 the fullscreen
behaviour is the same with or without this patch: the fullscreen
window is of the same size as the non-fullscreened version, with
a plain background behind it, so there's no aspect ratio issue.
I'm guessing that 10.6 behaved differently (the Lion fullscreen
changes were pretty drastic).

> - the inability to leave fullscreen mode
>
> signed-off-by: John Arbuckle <address@hidden>

This patch provokes a bunch of deprecation warnings:
  OBJC  ui/cocoa.o
/Users/pm215/src/qemu/ui/cocoa.m:490:25: warning:
'CGDisplayCurrentMode' is deprecated: first deprecated in OS X 10.6
[-Wdeprecated-declarations]
        original_mode = CGDisplayCurrentMode(kCGDirectMainDisplay);
                        ^
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:455:27:
note: 'CGDisplayCurrentMode' has been explicitly marked deprecated
here
CG_EXTERN CFDictionaryRef CGDisplayCurrentMode(CGDirectDisplayID display)
                          ^
/Users/pm215/src/qemu/ui/cocoa.m:494:13: warning:
'CGDisplaySwitchToMode' is deprecated: first deprecated in OS X 10.6
[-Wdeprecated-declarations]
            CGDisplaySwitchToMode(kCGDirectMainDisplay, original_mode);
            ^
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:460:19:
note: 'CGDisplaySwitchToMode' has been explicitly marked deprecated
here
CG_EXTERN CGError CGDisplaySwitchToMode(CGDirectDisplayID display,
                  ^
/Users/pm215/src/qemu/ui/cocoa.m:515:32: warning:
'CGDisplayBestModeForParameters' is deprecated: first deprecated in OS
X 10.6 [-Wdeprecated-declarations]
        CFDictionaryRef mode =
CGDisplayBestModeForParameters(kCGDirectMainDisplay,
desired_bit_depth, cw, ch, &exact_match);
                               ^
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:442:27:
note: 'CGDisplayBestModeForParameters' has been explicitly marked
deprecated here
CG_EXTERN CFDictionaryRef CGDisplayBestModeForParameters(CGDirectDisplayID
                          ^
/Users/pm215/src/qemu/ui/cocoa.m:517:13: warning:
'CGDisplaySwitchToMode' is deprecated: first deprecated in OS X 10.6
[-Wdeprecated-declarations]
            CGDisplaySwitchToMode(kCGDirectMainDisplay, mode);
            ^
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:460:19:
note: 'CGDisplaySwitchToMode' has been explicitly marked deprecated
here
CG_EXTERN CGError CGDisplaySwitchToMode(CGDirectDisplayID display,
                  ^
4 warnings generated.

which suggests we need a pre-10.6 codepath and a post-10.6 one
(unless we decide to trust that Apple will never ever delete
a deprecated API and turn off the warnings, which seems kinda
risky to me).

We also seem to need some 10.7-or-later code: I need at least
this patch to get fullscreen enabled at all:

@@ -833,6 +835,9 @@ QemuCocoaView *cocoaView;
         [normalWindow makeKeyAndOrderFront:self];
         [normalWindow center];

+        [normalWindow setCollectionBehavior:
+                        NSWindowCollectionBehaviorFullScreenPrimary];
+
     }
     return self;
 }

(that probably needs to be guarded with "if 10.7 or later" ifdefs).

and there are other problems with fullscreen still -- for instance
if you fullscreen the window before the guest changes its
resolution and then unfullscreen it afterwards, we forget about
the fact the resolution changed and revert to the pre-change size.

Another oddity: on fullscreening, the window's titlebar remains
visible, up until the point where the guest changes its screen
resolution, at which point it disappears. I'm guessing we shouldn't
display it at all in fullscreen.

I need to check whether we get the mouse coordinates right in
fullscreen mode, given that the window doesn't actually cover
the whole screen area.

If we're allowing mouse-ungrab in fullscreen mode, maybe we
should remove the "if (!isFullscreen)" guard from the code that
updates the window title with the "Press ctrl + alt to release
mouse" string? Slightly academic, though, since by definition
you can't read it if we're fullscreen...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]