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: Programmingkid
Subject: Re: [Qemu-devel] [PATCH] Fixes fullscreen aspect ratio and leaving fullscreen mode problem on Mac OS X
Date: Thu, 1 Jan 2015 11:05:53 -0500

On Jan 1, 2015, at 9:55 AM, Peter Maydell wrote:

> 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).

When you look at the openbios prompt in full screen mode, you can see the text 
is all messed up looking. That is because the aspect ratio isn't being 
preserved. 

Bad aspect ratio. The letters here are stretched out. 

image/jpg




Correct aspect ratio. You can notice that the letters here look sharper. 

image/jpg



I took these pictures using qemu-system-ppc. 


> 
>> - 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).

Ok, I will fix this problem. Your idea of pre and post 10.6 code will be 
implemented.

> 
> 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).

Ok, I will implement this in my patch also.


> 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.

I haven't noticed this issue. Which machine emulator are you using?


> 
> 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.

When qemu-system-ppc goes full screen, the menubar disappears over here. 

> 
> 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.

I haven't noticed any mouse coordinate problems on Mac OS 10.6. I will try my 
code out on other versions of Mac OS X to see if I can reproduce your issues.

> 
> 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...


Sounds like a good plan to me.


reply via email to

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