summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patches/qt4/patch-qeventdispatcher.diff86
-rw-r--r--patches/qt4/patch-qfontdatabase.diff29
-rw-r--r--src/openscad.cc7
-rw-r--r--tests/CMakeLists.txt6
4 files changed, 125 insertions, 3 deletions
diff --git a/patches/qt4/patch-qeventdispatcher.diff b/patches/qt4/patch-qeventdispatcher.diff
new file mode 100644
index 0000000..89ed478
--- /dev/null
+++ b/patches/qt4/patch-qeventdispatcher.diff
@@ -0,0 +1,86 @@
+--- src/gui/kernel/qeventdispatcher_mac_p.h 2013-06-07 01:16:59.000000000 -0400
++++ src/gui/kernel/qeventdispatcher_mac_p_new-8184b49c12d887928921ed5b695c8c6f04a07514.h 2013-12-08 14:31:01.000000000 -0500
+@@ -173,6 +173,7 @@
+ #ifdef QT_MAC_USE_COCOA
+ // The following variables help organizing modal sessions:
+ static QStack<QCocoaModalSessionInfo> cocoaModalSessionStack;
++ static QStack<QCocoaModalSessionInfo> cocoaModalSessionStackPendingEnd;
+ static bool currentExecIsNSAppRun;
+ static bool nsAppRunCalledByQt;
+ static bool cleanupModalSessionsNeeded;
+@@ -180,6 +181,7 @@
+ static NSModalSession currentModalSession();
+ static void updateChildrenWorksWhenModal();
+ static void temporarilyStopAllModalSessions();
++ static void stopAllPendingEndModalSessions();
+ static void beginModalSession(QWidget *widget);
+ static void endModalSession(QWidget *widget);
+ static void cancelWaitForMoreEvents();
+--- src/gui/kernel/qeventdispatcher_mac.mm 2013-06-07 01:16:59.000000000 -0400
++++ src/gui/kernel/qeventdispatcher_mac_new-833e02de99494686f8dd7a567f6e19e847508f11.mm 2013-12-08 14:30:59.000000000 -0500
+@@ -603,6 +603,9 @@
+ while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt)
+ qt_mac_waitForMoreModalSessionEvents();
+
++ // stop all pending end modal sessions
++ d->stopAllPendingEndModalSessions();
++
+ if (!d->interrupt && session == d->currentModalSessionCached) {
+ // Someone called [NSApp stopModal:] from outside the event
+ // dispatcher (e.g to stop a native dialog). But that call wrongly stopped
+@@ -678,6 +681,9 @@
+ if (!d->interrupt)
+ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
+
++ // stop all pending end modal sessions
++ d->stopAllPendingEndModalSessions();
++
+ // Since the window that holds modality might have changed while processing
+ // events, we we need to interrupt when we return back the previous process
+ // event recursion to ensure that we spin the correct modal session.
+@@ -781,6 +787,7 @@
+
+ #ifdef QT_MAC_USE_COCOA
+ QStack<QCocoaModalSessionInfo> QEventDispatcherMacPrivate::cocoaModalSessionStack;
++QStack<QCocoaModalSessionInfo> QEventDispatcherMacPrivate::cocoaModalSessionStackPendingEnd;
+ bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false;
+ bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false;
+ bool QEventDispatcherMacPrivate::cleanupModalSessionsNeeded = false;
+@@ -828,6 +835,20 @@
+ currentModalSessionCached = 0;
+ }
+
++void QEventDispatcherMacPrivate::stopAllPendingEndModalSessions()
++{
++ // stop all modal sessions pending end
++ int stackSize = cocoaModalSessionStackPendingEnd.size();
++ for (int i=stackSize-1; i>=0; --i) {
++ QCocoaModalSessionInfo &info = cocoaModalSessionStackPendingEnd[i];
++ cocoaModalSessionStackPendingEnd.remove(i);
++ if (info.session) {
++ [NSApp endModalSession:info.session];
++ [(NSWindow *)info.nswindow release];
++ }
++ }
++}
++
+ NSModalSession QEventDispatcherMacPrivate::currentModalSession()
+ {
+ // If we have one or more modal windows, this function will create
+@@ -925,10 +946,12 @@
+ }
+ cocoaModalSessionStack.remove(i);
+ currentModalSessionCached = 0;
+- if (info.session) {
+- [NSApp endModalSession:info.session];
+- [(NSWindow *)info.nswindow release];
+- }
++
++ // Cannot stop the sessions here since we might still be inside a
++ // [NSApp runModalSession:] call. Add the session to the pending end stack and
++ // process the stack after the call to [NSApp runModalSession:] returns.
++ if (info.session)
++ cocoaModalSessionStackPendingEnd.push(info);
+ }
+
+ updateChildrenWorksWhenModal();
diff --git a/patches/qt4/patch-qfontdatabase.diff b/patches/qt4/patch-qfontdatabase.diff
new file mode 100644
index 0000000..c078890
--- /dev/null
+++ b/patches/qt4/patch-qfontdatabase.diff
@@ -0,0 +1,29 @@
+--- src/gui/text/qfontdatabase.cpp 2013-06-07 01:16:59.000000000 -0400
++++ src/gui/text/qfontdatabase_new-bb2beddc3ae55c4676d190d0ac99aa32d322a6a5.cpp 2013-12-08 14:51:10.000000000 -0500
+@@ -441,6 +441,7 @@
+ #endif
+ #if !defined(QWS) && defined(Q_OS_MAC)
+ bool fixedPitchComputed : 1;
++ QString postscriptName;
+ #endif
+ #ifdef Q_WS_X11
+ bool symbol_checked : 1;
+--- src/gui/text/qfontdatabase_mac.cpp 2013-06-07 01:16:59.000000000 -0400
++++ src/gui/text/qfontdatabase_mac_new-41f29865db84152efb41c048470f713353a0a84c.cpp 2013-12-08 14:51:05.000000000 -0500
+@@ -147,6 +147,7 @@
+ QCFString family_name = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL);
+ QCFString style_name = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL);
+ QtFontFamily *family = db->family(family_name, true);
++ family->postscriptName = QCFString((CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontNameAttribute));
+
+ if (QCFType<CFArrayRef> languages = (CFArrayRef) CTFontDescriptorCopyAttribute(font, kCTFontLanguagesAttribute)) {
+ CFIndex length = CFArrayGetCount(languages);
+@@ -327,7 +328,7 @@
+ if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) {
+ QByteArray family_name = db->families[k]->name.toUtf8();
+ #if defined(QT_MAC_USE_COCOA)
+- QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL);
++ QCFType<CTFontRef> ctFont = CTFontCreateWithName(QCFString(db->families[k]->postscriptName), 12, NULL);
+ if (ctFont) {
+ fontName = CTFontCopyFullName(ctFont);
+ goto found;
diff --git a/src/openscad.cc b/src/openscad.cc
index ece6818..ab84235 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -474,6 +474,13 @@ bool QtUseGUI()
int gui(vector<string> &inputFiles, const fs::path &original_path, int argc, char ** argv)
{
+#ifdef Q_OS_MACX
+ if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8) {
+ // fix Mac OS X 10.9 (mavericks) font issue
+ // https://bugreports.qt-project.org/browse/QTBUG-32789
+ QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
+ }
+#endif
QApplication app(argc, argv, true); //useGUI);
#ifdef Q_WS_MAC
app.installEventFilter(new EventFilter(&app));
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b84775b..f92eddf 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,14 +14,14 @@ include(CMakeParseArguments.cmake)
# Detect Lion and force gcc
IF (APPLE)
- # Somehow, since we build dependencies for 10.7, we need to also build executables
- # for 10.7. This used to not be necessary, but since 10.9 it apparently is..
- SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
EXECUTE_PROCESS(COMMAND sw_vers -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
IF (NOT ${MACOSX_VERSION} VERSION_LESS "10.9.0")
message("Detected Maverick (10.9) or later")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
+ # Somehow, since we build dependencies for 10.7, we need to also build executables
+ # for 10.7. This used to not be necessary, but since 10.9 it apparently is..
+ SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "Deployment target")
ELSEIF (NOT ${MACOSX_VERSION} VERSION_LESS "10.8.0")
message("Detected Mountain Lion (10.8)")
set(CMAKE_C_COMPILER "clang")
contact: Jan Huwald // Impressum