qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Fixes several full screen issues on Mac OS X


From: Programmingkid
Subject: Re: [Qemu-devel] [PATCH] Fixes several full screen issues on Mac OS X
Date: Wed, 14 Jan 2015 13:18:47 -0500

On Jan 14, 2015, at 12:19 PM, Peter Maydell wrote:

> On 4 January 2015 at 23:44, Programmingkid <address@hidden> wrote:
>> This patch makes several changes:
>> - Fixes issue of returning to window mode and QEMU not setting
>> the right graphic settings if there was a change during full screen mode.
>> - Eliminated distorted full screen display.
>> - Makes full screen mode available on Mac OS 10.7 and higher.
>> - Removes unneeded global variables cdx, and cdy.
>> - Changes a few comments to make them clearer.
>> 
>> Signed-off-by: John Arbuckle <address@hidden>
> 
> I'm afraid this patch is badly broken for me.
> 
> (1) If I go into full screen then I can't get out again because the
> menubar isn't displayed even when I use ctrl+alt to release the
> mouse grab. I have to use my second monitor to get at the Dock so I
> can kill QEMU.

You would use Command - F after you have released the mouse grab to return to 
window mode.


> (2) Having done this I find that all my other application windows
> have been squashed down into a corner of my screen, presumably because
> we've told MacOSX "the screen is 640x480" and it's rearranged the
> app windows to suit. We mustn't mess things up like this.

This can't be avoided. When the screen resolution changes, all the applications 
usually adjust to the new size. It is the same thing that happens when you use 
a full screen game. 

> 
> (3) I managed to get at the underlying "QEMU" window with its title
> bar somehow even when in full screen mode: I could move it about the
> screen with the mouse...

Really? I think you said you had Mac OS 10.7. I don't have that, but I do have 
access to Mac OS 10.9. Just send me the instructions on how to reproduce this. 

> 
> (4) I get a lot of compile warnings for this patch:
> 
>  OBJC  ui/cocoa.o
> /Users/pm215/src/qemu/ui/cocoa.m:790:24: warning:
> 'CGDisplayCurrentMode' is deprecated: first deprecated in OS X 10.6
>      [-Wdeprecated-declarations]
>    window_mode_dict = 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:790:22: warning: incompatible pointer
> types assigning to 'NSDictionary *' from 'CFDictionaryRef'
>      (aka 'const struct __CFDictionary *') [-Wincompatible-pointer-types]
>    window_mode_dict = CGDisplayCurrentMode(kCGDirectMainDisplay);
>                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/pm215/src/qemu/ui/cocoa.m:796:5: warning:
> 'CGDisplaySwitchToMode' is deprecated: first deprecated in OS X 10.6
>      [-Wdeprecated-declarations]
>    CGDisplaySwitchToMode(kCGDirectMainDisplay, window_mode_dict);
>    ^
> /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:796:49: warning: incompatible pointer
> types passing 'NSDictionary *' to parameter of type
>      'CFDictionaryRef' (aka 'const struct __CFDictionary *')
> [-Wincompatible-pointer-types]
>    CGDisplaySwitchToMode(kCGDirectMainDisplay, window_mode_dict);
>                                                ^~~~~~~~~~~~~~~~
> /System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:461:19:
> note: passing argument to parameter 'mode' here
>  CFDictionaryRef mode) CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6,
>                  ^
> /Users/pm215/src/qemu/ui/cocoa.m:804:20: warning: incompatible pointer
> types initializing 'NSDictionary *' with an expression of type
>      'CFDictionaryRef' (aka 'const struct __CFDictionary *')
> [-Wincompatible-pointer-types]
>  ...* mode = CGDisplayBestModeForParameters(kCGDirectMainDisplay,
> desired_bit_depth, (size_t)cw, (size_t)ch, &exact_match);
>       ^      
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/pm215/src/qemu/ui/cocoa.m:804:27: warning:
> 'CGDisplayBestModeForParameters' is deprecated: first deprecated in OS
> X 10.6
>      [-Wdeprecated-declarations]
>    NSDictionary * mode =
> CGDisplayBestModeForParameters(kCGDirectMainDisplay,
> desired_bit_depth, (size_t)cw, (size_t)ch, &ex...
>                          ^
> /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:807:9: 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,
>                  ^
> /Users/pm215/src/qemu/ui/cocoa.m:807:53: warning: incompatible pointer
> types passing 'NSDictionary *' to parameter of type
>      'CFDictionaryRef' (aka 'const struct __CFDictionary *')
> [-Wincompatible-pointer-types]
>        CGDisplaySwitchToMode(kCGDirectMainDisplay, mode);
>                                                    ^~~~
> /System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:461:19:
> note: passing argument to parameter 'mode' here
>  CFDictionaryRef mode) CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6,
>                  ^
> 8 warnings generated.

Disabling the depreciation warning would eliminate these errors. 


> 
> (5) checkpatch also complains about trailing whitespace:
> 
> ERROR: trailing whitespace
> #97: FILE: ui/cocoa.m:420:
> +        ch = screen.height;        $
> 
> ERROR: trailing whitespace
> #133: FILE: ui/cocoa.m:448:
> +            it is the solution that works. I spent a long time looking $
> 
> ERROR: trailing whitespace
> #223: FILE: ui/cocoa.m:950:
> +because Mac OS 10.7 and higher disables it. This is because of the $
> 
> total: 3 errors, 0 warnings, 223 lines checked

I thought I did use checkpatch.pl on this. Will correct this issue.

> 
> 
>> - (void) switchSurface:(DisplaySurface *)surface
>> {
>>     COCOA_DEBUG("QemuCocoaView: switchSurface\n");
>> -
>>     int w = surface_width(surface);
>>     int h = surface_height(surface);
>> -    /* cdx == 0 means this is our very first surface, in which case we need
>> -     * to recalculate the content dimensions even if it happens to be the 
>> size
>> -     * of the initial empty window.
>> -     */
>> -    bool isResize = (w != screen.width || h != screen.height || cdx == 0.0);
>> -
>> +    bool isResize = (w != screen.width || h != screen.height);
> 
> (6) This looks like you've just dropped a bug fix. How are you
> dealing with this case if not by the method described in the
> now-deleted comment?

If the guest does change its resolution, then we try to match it in the host. 
When I eliminated this code, it made the guest look so much better. I was 
actually able to read documents in the guest at full screen. 


reply via email to

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