From 069ce7afc1cf2c70cbf3ea201d5503197eb46757 Mon Sep 17 00:00:00 2001 From: "Javier O. Cordero" Date: Tue, 28 Jun 2022 16:47:12 -0400 Subject: [PATCH] Completely disabled KDMacTouchBar in order to ensure compatibility with Rossetta, since x86_64 build fails to launch on arm64 systems but arm64 build of the same launches fine. --- CMakeLists.txt | 10 +++++--- src/CMakeLists.txt | 10 ++++---- src/main.cpp | 62 +++++++++++++++++++++++----------------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17fdd8c4..d99b1d77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,6 +122,8 @@ endif() if (NOT EXISTS "${PROJECT_SOURCE_DIR}/3rdparty/KDMacTouchBar/CMakeLists.txt" AND APPLE AND NOT IOS) message(FATAL_ERROR "KDMacTouchBar was not downloaded. GIT_SUBMODULE was turned off or failed.") endif() + + if(ANDROID) find_package(Qt${QT_VERSION_MAJOR} ${QT5_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core @@ -197,10 +199,10 @@ elseif(WIN32 OR APPLE) # set(QHOTKEY_EXAMPLES OFF CACHE INTERNAL "") # set(QHOTKEY_INSTALL OFF CACHE INTERNAL "") # add_subdirectory("3rdparty/QHotkey" build/qhotkey) - # KDMacTouchBar (Mac only) - if(APPLE AND NOT IOS) - add_subdirectory("3rdparty/KDMacTouchBar" build/kdmactouchbar) - endif() +# # KDMacTouchBar (Mac only) +# if(APPLE AND NOT IOS) +# add_subdirectory("3rdparty/KDMacTouchBar" build/kdmactouchbar) +# endif() else() find_package(Qt${QT_VERSION_MAJOR} ${QT5_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1cd7fb5e..9e2f9efa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -220,11 +220,11 @@ elseif(WIN32 OR APPLE) KF5::CoreAddons # QHotkey::QHotkey ) - if(APPLE AND NOT IOS) - target_include_directories(mactouchbar PUBLIC ${kdmactouchbar_SOURCE_DIR}/KDMacTouchBar) - target_link_directories(mactouchbar PUBLIC ${kdmactouchbar_SOURCE_DIR}/KDMacTouchBar) - target_link_libraries(${PROJECT_NAME} PUBLIC KDMacTouchBar) - endif() +# if(APPLE AND NOT IOS) +# target_include_directories(mactouchbar PUBLIC ${kdmactouchbar_SOURCE_DIR}/KDMacTouchBar) +# target_link_directories(mactouchbar PUBLIC ${kdmactouchbar_SOURCE_DIR}/KDMacTouchBar) +# target_link_libraries(${PROJECT_NAME} PUBLIC KDMacTouchBar) +# endif() else() target_include_directories(${PROJECT_NAME} PUBLIC ${qhotkey_SOURCE_DIR}/QHotkey) target_link_directories(${PROJECT_NAME} PUBLIC ${qhotkey_SOURCE_DIR}/QHotkey) diff --git a/src/main.cpp b/src/main.cpp index 7817f67a..2a6f01a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,9 +44,9 @@ #include //#include -#if defined(Q_OS_MACOS) -#include <../3rdparty/KDMacTouchBar/src/kdmactouchbar.h> -#endif +//#if defined(Q_OS_MACOS) +//#include <../3rdparty/KDMacTouchBar/src/kdmactouchbar.h> +//#endif #include "../qprompt_version.h" #include "prompter/documenthandler.h" @@ -124,34 +124,34 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) // KirigamiPlugin::getInstance().registerTypes(); // #endif -#if defined(Q_OS_MACOS) - // Enable automatic display of dialog prompts on the touchbar. - KDMacTouchBar::setAutomaticallyCreateMessageBoxTouchBar(true); - // Create touchbar for use through all of QPrompt's execusion - KDMacTouchBar *touchBar = new KDMacTouchBar(); - // Toggle teleprompter state - QIcon QPromptIcon(QStringLiteral("://images/qprompt.png")); - QAction *action = new QAction(QPromptIcon, "Toggle"); - touchBar->addAction(action); - // connect(action, &QAction::triggered, this, &MainWindow::activated); - touchBar->addSeparator(); - // Velocity and placement toachbar controls - // Up - QIcon upIcon(QStringLiteral("://go-up")); - QAction *reduceAction = new QAction(upIcon, "Reduce"); - touchBar->addAction(reduceAction); - // connect(reduceAction, &QAction::triggered, this, &MainWindow::activated); - // Down - QIcon downIcon(QStringLiteral("://go-down")); - QAction *increaseAction = new QAction(downIcon, "Increase"); - touchBar->addAction(increaseAction); - // connect(increaseAction, &QAction::triggered, this, &MainWindow::activated); - touchBar->addSeparator(); -// // Stop prompter -// QAction *stopAction = new QAction(upIcon, "Stop"); -// touchBar->addAction(stopAction); -// // connect(stopAction, &QAction::triggered, this, &MainWindow::activated); -#endif +//#if defined(Q_OS_MACOS) +// // Enable automatic display of dialog prompts on the touchbar. +// KDMacTouchBar::setAutomaticallyCreateMessageBoxTouchBar(true); +// // Create touchbar for use through all of QPrompt's execusion +// KDMacTouchBar *touchBar = new KDMacTouchBar(); +// // Toggle teleprompter state +// QIcon QPromptIcon(QStringLiteral("://images/qprompt.png")); +// QAction *action = new QAction(QPromptIcon, "Toggle"); +// touchBar->addAction(action); +// // connect(action, &QAction::triggered, this, &MainWindow::activated); +// touchBar->addSeparator(); +// // Velocity and placement toachbar controls +// // Up +// QIcon upIcon(QStringLiteral("://go-up")); +// QAction *reduceAction = new QAction(upIcon, "Reduce"); +// touchBar->addAction(reduceAction); +// // connect(reduceAction, &QAction::triggered, this, &MainWindow::activated); +// // Down +// QIcon downIcon(QStringLiteral("://go-down")); +// QAction *increaseAction = new QAction(downIcon, "Increase"); +// touchBar->addAction(increaseAction); +// // connect(increaseAction, &QAction::triggered, this, &MainWindow::activated); +// touchBar->addSeparator(); +//// // Stop prompter +//// QAction *stopAction = new QAction(upIcon, "Stop"); +//// touchBar->addAction(stopAction); +//// // connect(stopAction, &QAction::triggered, this, &MainWindow::activated); +//#endif // QHotkey hotkey(QKeySequence("Alt+Q"), true, &app); // qDebug() << "Is segistered:" << hotkey.isRegistered();