Merge remote-tracking branch 'origin/issue5620-sierra' into v1.8.5

This commit is contained in:
Jerry (Xinyu Hou) 2016-10-19 10:54:31 +01:00
commit 984ca48f34
5 changed files with 16 additions and 10 deletions

View File

@ -430,14 +430,16 @@ class InternalCommands:
if generator.cmakeName.find('Unix Makefiles') != -1: if generator.cmakeName.find('Unix Makefiles') != -1:
cmake_args += ' -DCMAKE_BUILD_TYPE=' + target.capitalize() cmake_args += ' -DCMAKE_BUILD_TYPE=' + target.capitalize()
elif sys.platform == "darwin": if sys.platform == "darwin":
macSdkMatch = re.match("(\d+)\.(\d+)", self.macSdk) macSdkMatch = re.match("(\d+)\.(\d+)", self.macSdk)
if not macSdkMatch: if not macSdkMatch:
raise Exception("unknown osx version: " + self.macSdk) raise Exception("unknown osx version: " + self.macSdk)
if generator.cmakeName.find('Unix Makefiles') == -1:
sdkDir = self.getMacSdkDir() sdkDir = self.getMacSdkDir()
cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir
cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk
cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1) cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1)
cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2) cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2)
@ -551,6 +553,7 @@ class InternalCommands:
if os.path.exists(sdkPath): if os.path.exists(sdkPath):
return sdkPath return sdkPath
# return os.popen('xcodebuild -version -sdk macosx' + self.macSdk + ' Path').read().strip()
return "/Developer/SDKs/" + sdkDirName + ".sdk" return "/Developer/SDKs/" + sdkDirName + ".sdk"
# http://tinyurl.com/cs2rxxb # http://tinyurl.com/cs2rxxb

View File

@ -19,7 +19,7 @@ if (WIN32)
file(GLOB sources "MSWindows*.cpp") file(GLOB sources "MSWindows*.cpp")
elseif (APPLE) elseif (APPLE)
file(GLOB headers "OSX*.h" "IOSX*.h") file(GLOB headers "OSX*.h" "IOSX*.h")
file(GLOB sources "OSX*.cpp" "IOSX*.cpp" "OSX*.m") file(GLOB sources "OSX*.cpp" "IOSX*.cpp" "OSX*.m" "OSX*.mm")
elseif (UNIX) elseif (UNIX)
file(GLOB headers "XWindows*.h") file(GLOB headers "XWindows*.h")
file(GLOB sources "XWindows*.cpp") file(GLOB sources "XWindows*.cpp")

View File

@ -122,7 +122,7 @@ OSXClipboard::add(EFormat format, const String & data)
PasteboardPutItemFlavor( PasteboardPutItemFlavor(
m_pboard, m_pboard,
(PasteboardItemID) 0, nullptr,
flavorType, flavorType,
dataRef, dataRef,
kPasteboardFlavorNoFlags); kPasteboardFlavorNoFlags);

View File

@ -344,4 +344,6 @@ private:
Mutex* m_carbonLoopMutex; Mutex* m_carbonLoopMutex;
CondVar<bool>* m_carbonLoopReady; CondVar<bool>* m_carbonLoopReady;
#endif #endif
class OSXScreenImpl* m_impl;
}; };

View File

@ -45,6 +45,8 @@
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
#include <IOKit/hidsystem/event_status_driver.h> #include <IOKit/hidsystem/event_status_driver.h>
#import <appkit/NSEvent.h>
// Set some enums for fast user switching if we're building with an SDK // Set some enums for fast user switching if we're building with an SDK
// from before such support was added. // from before such support was added.
#if !defined(MAC_OS_X_VERSION_10_3) || \ #if !defined(MAC_OS_X_VERSION_10_3) || \
@ -112,7 +114,8 @@ OSXScreen::OSXScreen(IEventQueue* events, bool isPrimary, bool autoShowHideCurso
m_lastSingleClickYCursor(0), m_lastSingleClickYCursor(0),
m_autoShowHideCursor(autoShowHideCursor), m_autoShowHideCursor(autoShowHideCursor),
m_events(events), m_events(events),
m_getDropTargetThread(NULL) m_getDropTargetThread(NULL),
m_impl(NULL)
{ {
try { try {
m_displayID = CGMainDisplayID(); m_displayID = CGMainDisplayID();
@ -526,9 +529,7 @@ OSXScreen::fakeMouseButton(ButtonID id, bool press)
// we define our own defaults. // we define our own defaults.
const double maxDiff = sqrt(2) + 0.0001; const double maxDiff = sqrt(2) + 0.0001;
double clickTime = [NSEvent doubleClickInterval];
NXEventHandle handle = NXOpenEventStatus();
double clickTime = NXClickTime(handle);
// As long as the click is within the time window and distance window // As long as the click is within the time window and distance window
// increase clickState (double click, triple click, etc) // increase clickState (double click, triple click, etc)