Skip to content

Commit

Permalink
Completely disabled KDMacTouchBar in order to ensure compatibility wi…
Browse files Browse the repository at this point in the history
…th Rossetta, since x86_64 build fails to launch on arm64 systems but arm64 build of the same launches fine.
  • Loading branch information
Cuperino committed Jun 28, 2022
1 parent 0a412ed commit 069ce7a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 40 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
62 changes: 31 additions & 31 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
#include <KCoreAddons/KAboutData>

//#include <QHotkey>
#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"
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 069ce7a

Please sign in to comment.