From: Programmingkid <programmingkidx@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel qemu-devel <qemu-devel@nongnu.org>
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 [thread overview]
Message-ID: <94238B45-AE52-49B5-8081-8DB4E710C8EC@gmail.com> (raw)
In-Reply-To: <CAFEAcA_E7zWeHOcnRH5QYWa+WGEDkREEjAnfC8tRWMbg=o-MTg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
On Jan 1, 2015, at 9:55 AM, Peter Maydell wrote:
> On 30 December 2014 at 04:17, Programmingkid <programmingkidx@gmail.com> 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.
[-- Attachment #2: bad aspect ratio.jpeg --]
[-- Type: image/jpg, Size: 55152 bytes --]
[-- Attachment #3: Type: text/plain, Size: 78 bytes --]
Correct aspect ratio. You can notice that the letters here look sharper.
[-- Attachment #4: Correct aspect ratio.jpeg --]
[-- Type: image/jpg, Size: 61571 bytes --]
[-- Attachment #5: Type: text/plain, Size: 4609 bytes --]
I took these pictures using qemu-system-ppc.
>
>> - the inability to leave fullscreen mode
>>
>> signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>
> 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.
next prev parent reply other threads:[~2015-01-01 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-30 4:17 [Qemu-devel] [PATCH] Fixes fullscreen aspect ratio and leaving fullscreen mode problem on Mac OS X Programmingkid
2014-12-31 23:19 ` Peter Maydell
2015-01-01 14:55 ` Peter Maydell
2015-01-01 16:05 ` Programmingkid [this message]
2015-01-01 16:48 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94238B45-AE52-49B5-8081-8DB4E710C8EC@gmail.com \
--to=programmingkidx@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).