From 3bbba7d2b13c4fffe69d566ec91a7ae53c340d36 Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Wed, 13 Aug 2014 15:27:41 +0200 Subject: [PATCH] OSX: add a fix for lion_fs loosing handles after calling fs from key shortcut, also reenabled lion_fs for OSX >= 10.9 again --- intern/ghost/intern/GHOST_SystemCocoa.mm | 4 ++-- intern/ghost/intern/GHOST_WindowCocoa.mm | 17 ++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 2e372d7c995..3bef63a2cee 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -736,10 +736,10 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent) handleKeyEvent(event); } else { - // For some reason NSApp is swallowing the key up events when command + // For some reason NSApp is swallowing the key up events when modifier // key is pressed, even if there seems to be no apparent reason to do // so, as a workaround we always handle these up events. - if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) + if ([event type] == NSKeyUp && (([event modifierFlags] & NSCommandKeyMask) || [event modifierFlags] & NSAlternateKeyMask)) handleKeyEvent(event); [NSApp sendEvent:event]; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 41be2801146..f9b8899fbe5 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -728,15 +728,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( if (state == GHOST_kWindowStateFullScreen) setState(GHOST_kWindowStateFullScreen); -//Using lion_fullscreen suffers from an uncovered problem when called from operator, disabled for now -// //Starting with 10.9 (darwin 13.x.x), we always use Lion fullscreen, since it -// //now has proper multi-monitor support for fullscreen -// char darwin_ver[10]; -// size_t len = sizeof(darwin_ver); -// sysctlbyname("kern.osrelease", &darwin_ver, &len, NULL, 0); -// if(darwin_ver[0] == '1' && darwin_ver[1] >= '3') { -// m_lionStyleFullScreen = true; -// } + //Starting with 10.9 (darwin 13.x.x), we always use Lion fullscreen, since it + //now has proper multi-monitor support for fullscreen + char darwin_ver[10]; + size_t len = sizeof(darwin_ver); + sysctlbyname("kern.osrelease", &darwin_ver, &len, NULL, 0); + if(darwin_ver[0] == '1' && darwin_ver[1] >= '3') { + m_lionStyleFullScreen = true; + } [pool drain]; }