On 4 January 2015 at 23:44, Programmingkid <programmingk...@gmail.com> 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 <programmingk...@gmail.com>
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. (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. (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... (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. (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 > - (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? thanks -- PMM