diff options
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 26 | ||||
| -rw-r--r-- | src/yuzu/main.h | 6 |
4 files changed, 20 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b625743ea..c6fc5dd9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -218,11 +218,11 @@ if(ENABLE_QT) | |||
| 218 | set(QT_VERSION 5.15) | 218 | set(QT_VERSION 5.15) |
| 219 | 219 | ||
| 220 | # Check for system Qt on Linux, fallback to bundled Qt | 220 | # Check for system Qt on Linux, fallback to bundled Qt |
| 221 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | 221 | if (UNIX AND NOT APPLE) |
| 222 | if (NOT YUZU_USE_BUNDLED_QT) | 222 | if (NOT YUZU_USE_BUNDLED_QT) |
| 223 | find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets DBus Multimedia) | 223 | find_package(Qt5 ${QT_VERSION} COMPONENTS Widgets DBus Multimedia) |
| 224 | endif() | 224 | endif() |
| 225 | if (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT) | 225 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND (NOT Qt5_FOUND OR YUZU_USE_BUNDLED_QT)) |
| 226 | # Check for dependencies, then enable bundled Qt download | 226 | # Check for dependencies, then enable bundled Qt download |
| 227 | 227 | ||
| 228 | # Check that the system GLIBCXX version is compatible | 228 | # Check that the system GLIBCXX version is compatible |
| @@ -323,7 +323,7 @@ if(ENABLE_QT) | |||
| 323 | 323 | ||
| 324 | set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH") | 324 | set(YUZU_QT_NO_CMAKE_SYSTEM_PATH "NO_CMAKE_SYSTEM_PATH") |
| 325 | endif() | 325 | endif() |
| 326 | if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND YUZU_USE_BUNDLED_QT) | 326 | if (UNIX AND NOT APPLE AND YUZU_USE_BUNDLED_QT) |
| 327 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia DBus ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH}) | 327 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia DBus ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH}) |
| 328 | else() | 328 | else() |
| 329 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH}) | 329 | find_package(Qt5 ${QT_VERSION} REQUIRED COMPONENTS Widgets Concurrent Multimedia ${QT_PREFIX_HINT} ${YUZU_QT_NO_CMAKE_SYSTEM_PATH}) |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 29d506c47..239f12382 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -315,7 +315,7 @@ target_include_directories(yuzu PRIVATE ../../externals/Vulkan-Headers/include) | |||
| 315 | if (NOT WIN32) | 315 | if (NOT WIN32) |
| 316 | target_include_directories(yuzu PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) | 316 | target_include_directories(yuzu PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) |
| 317 | endif() | 317 | endif() |
| 318 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | 318 | if (UNIX AND NOT APPLE) |
| 319 | target_link_libraries(yuzu PRIVATE Qt::DBus) | 319 | target_link_libraries(yuzu PRIVATE Qt::DBus) |
| 320 | endif() | 320 | endif() |
| 321 | 321 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 7b16d7f7e..59e56633a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #ifdef __APPLE__ | 9 | #ifdef __APPLE__ |
| 10 | #include <unistd.h> // for chdir | 10 | #include <unistd.h> // for chdir |
| 11 | #endif | 11 | #endif |
| 12 | #ifdef __linux__ | 12 | #ifdef __unix__ |
| 13 | #include <csignal> | 13 | #include <csignal> |
| 14 | #include <sys/socket.h> | 14 | #include <sys/socket.h> |
| 15 | #endif | 15 | #endif |
| @@ -275,7 +275,7 @@ static void OverrideWindowsFont() { | |||
| 275 | #endif | 275 | #endif |
| 276 | 276 | ||
| 277 | bool GMainWindow::CheckDarkMode() { | 277 | bool GMainWindow::CheckDarkMode() { |
| 278 | #ifdef __linux__ | 278 | #ifdef __unix__ |
| 279 | const QPalette test_palette(qApp->palette()); | 279 | const QPalette test_palette(qApp->palette()); |
| 280 | const QColor text_color = test_palette.color(QPalette::Active, QPalette::Text); | 280 | const QColor text_color = test_palette.color(QPalette::Active, QPalette::Text); |
| 281 | const QColor window_color = test_palette.color(QPalette::Active, QPalette::Window); | 281 | const QColor window_color = test_palette.color(QPalette::Active, QPalette::Window); |
| @@ -283,7 +283,7 @@ bool GMainWindow::CheckDarkMode() { | |||
| 283 | #else | 283 | #else |
| 284 | // TODO: Windows | 284 | // TODO: Windows |
| 285 | return false; | 285 | return false; |
| 286 | #endif // __linux__ | 286 | #endif // __unix__ |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | GMainWindow::GMainWindow(std::unique_ptr<Config> config_, bool has_broken_vulkan) | 289 | GMainWindow::GMainWindow(std::unique_ptr<Config> config_, bool has_broken_vulkan) |
| @@ -291,7 +291,7 @@ GMainWindow::GMainWindow(std::unique_ptr<Config> config_, bool has_broken_vulkan | |||
| 291 | input_subsystem{std::make_shared<InputCommon::InputSubsystem>()}, config{std::move(config_)}, | 291 | input_subsystem{std::make_shared<InputCommon::InputSubsystem>()}, config{std::move(config_)}, |
| 292 | vfs{std::make_shared<FileSys::RealVfsFilesystem>()}, | 292 | vfs{std::make_shared<FileSys::RealVfsFilesystem>()}, |
| 293 | provider{std::make_unique<FileSys::ManualContentProvider>()} { | 293 | provider{std::make_unique<FileSys::ManualContentProvider>()} { |
| 294 | #ifdef __linux__ | 294 | #ifdef __unix__ |
| 295 | SetupSigInterrupts(); | 295 | SetupSigInterrupts(); |
| 296 | #endif | 296 | #endif |
| 297 | system->Initialize(); | 297 | system->Initialize(); |
| @@ -509,7 +509,7 @@ GMainWindow::~GMainWindow() { | |||
| 509 | delete render_window; | 509 | delete render_window; |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | #ifdef __linux__ | 512 | #ifdef __unix__ |
| 513 | ::close(sig_interrupt_fds[0]); | 513 | ::close(sig_interrupt_fds[0]); |
| 514 | ::close(sig_interrupt_fds[1]); | 514 | ::close(sig_interrupt_fds[1]); |
| 515 | #endif | 515 | #endif |
| @@ -1379,7 +1379,7 @@ void GMainWindow::OnDisplayTitleBars(bool show) { | |||
| 1379 | } | 1379 | } |
| 1380 | 1380 | ||
| 1381 | void GMainWindow::SetupPrepareForSleep() { | 1381 | void GMainWindow::SetupPrepareForSleep() { |
| 1382 | #ifdef __linux__ | 1382 | #ifdef __unix__ |
| 1383 | auto bus = QDBusConnection::systemBus(); | 1383 | auto bus = QDBusConnection::systemBus(); |
| 1384 | if (bus.isConnected()) { | 1384 | if (bus.isConnected()) { |
| 1385 | const bool success = bus.connect( | 1385 | const bool success = bus.connect( |
| @@ -1393,7 +1393,7 @@ void GMainWindow::SetupPrepareForSleep() { | |||
| 1393 | } else { | 1393 | } else { |
| 1394 | LOG_WARNING(Frontend, "QDBusConnection system bus is not connected"); | 1394 | LOG_WARNING(Frontend, "QDBusConnection system bus is not connected"); |
| 1395 | } | 1395 | } |
| 1396 | #endif // __linux__ | 1396 | #endif // __unix__ |
| 1397 | } | 1397 | } |
| 1398 | 1398 | ||
| 1399 | void GMainWindow::OnPrepareForSleep(bool prepare_sleep) { | 1399 | void GMainWindow::OnPrepareForSleep(bool prepare_sleep) { |
| @@ -1415,7 +1415,7 @@ void GMainWindow::OnPrepareForSleep(bool prepare_sleep) { | |||
| 1415 | } | 1415 | } |
| 1416 | } | 1416 | } |
| 1417 | 1417 | ||
| 1418 | #ifdef __linux__ | 1418 | #ifdef __unix__ |
| 1419 | static std::optional<QDBusObjectPath> HoldWakeLockLinux(u32 window_id = 0) { | 1419 | static std::optional<QDBusObjectPath> HoldWakeLockLinux(u32 window_id = 0) { |
| 1420 | if (!QDBusConnection::sessionBus().isConnected()) { | 1420 | if (!QDBusConnection::sessionBus().isConnected()) { |
| 1421 | return {}; | 1421 | return {}; |
| @@ -1500,14 +1500,14 @@ void GMainWindow::OnSigInterruptNotifierActivated() { | |||
| 1500 | 1500 | ||
| 1501 | emit SigInterrupt(); | 1501 | emit SigInterrupt(); |
| 1502 | } | 1502 | } |
| 1503 | #endif // __linux__ | 1503 | #endif // __unix__ |
| 1504 | 1504 | ||
| 1505 | void GMainWindow::PreventOSSleep() { | 1505 | void GMainWindow::PreventOSSleep() { |
| 1506 | #ifdef _WIN32 | 1506 | #ifdef _WIN32 |
| 1507 | SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); | 1507 | SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); |
| 1508 | #elif defined(HAVE_SDL2) | 1508 | #elif defined(HAVE_SDL2) |
| 1509 | SDL_DisableScreenSaver(); | 1509 | SDL_DisableScreenSaver(); |
| 1510 | #ifdef __linux__ | 1510 | #ifdef __unix__ |
| 1511 | auto reply = HoldWakeLockLinux(winId()); | 1511 | auto reply = HoldWakeLockLinux(winId()); |
| 1512 | if (reply) { | 1512 | if (reply) { |
| 1513 | wake_lock = std::move(reply.value()); | 1513 | wake_lock = std::move(reply.value()); |
| @@ -1521,7 +1521,7 @@ void GMainWindow::AllowOSSleep() { | |||
| 1521 | SetThreadExecutionState(ES_CONTINUOUS); | 1521 | SetThreadExecutionState(ES_CONTINUOUS); |
| 1522 | #elif defined(HAVE_SDL2) | 1522 | #elif defined(HAVE_SDL2) |
| 1523 | SDL_EnableScreenSaver(); | 1523 | SDL_EnableScreenSaver(); |
| 1524 | #ifdef __linux__ | 1524 | #ifdef __unix__ |
| 1525 | if (!wake_lock.path().isEmpty()) { | 1525 | if (!wake_lock.path().isEmpty()) { |
| 1526 | ReleaseWakeLockLinux(wake_lock); | 1526 | ReleaseWakeLockLinux(wake_lock); |
| 1527 | } | 1527 | } |
| @@ -4070,7 +4070,7 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) { | |||
| 4070 | } | 4070 | } |
| 4071 | 4071 | ||
| 4072 | void GMainWindow::changeEvent(QEvent* event) { | 4072 | void GMainWindow::changeEvent(QEvent* event) { |
| 4073 | #ifdef __linux__ | 4073 | #ifdef __unix__ |
| 4074 | // PaletteChange event appears to only reach so far into the GUI, explicitly asking to | 4074 | // PaletteChange event appears to only reach so far into the GUI, explicitly asking to |
| 4075 | // UpdateUITheme is a decent work around | 4075 | // UpdateUITheme is a decent work around |
| 4076 | if (event->type() == QEvent::PaletteChange) { | 4076 | if (event->type() == QEvent::PaletteChange) { |
| @@ -4085,7 +4085,7 @@ void GMainWindow::changeEvent(QEvent* event) { | |||
| 4085 | } | 4085 | } |
| 4086 | last_window_color = window_color; | 4086 | last_window_color = window_color; |
| 4087 | } | 4087 | } |
| 4088 | #endif // __linux__ | 4088 | #endif // __unix__ |
| 4089 | QWidget::changeEvent(event); | 4089 | QWidget::changeEvent(event); |
| 4090 | } | 4090 | } |
| 4091 | 4091 | ||
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index f7aa8e417..150ada84c 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "yuzu/compatibility_list.h" | 15 | #include "yuzu/compatibility_list.h" |
| 16 | #include "yuzu/hotkeys.h" | 16 | #include "yuzu/hotkeys.h" |
| 17 | 17 | ||
| 18 | #ifdef __linux__ | 18 | #ifdef __unix__ |
| 19 | #include <QVariant> | 19 | #include <QVariant> |
| 20 | #include <QtDBus/QDBusInterface> | 20 | #include <QtDBus/QDBusInterface> |
| 21 | #include <QtDBus/QtDBus> | 21 | #include <QtDBus/QtDBus> |
| @@ -255,7 +255,7 @@ private: | |||
| 255 | void changeEvent(QEvent* event) override; | 255 | void changeEvent(QEvent* event) override; |
| 256 | void closeEvent(QCloseEvent* event) override; | 256 | void closeEvent(QCloseEvent* event) override; |
| 257 | 257 | ||
| 258 | #ifdef __linux__ | 258 | #ifdef __unix__ |
| 259 | void SetupSigInterrupts(); | 259 | void SetupSigInterrupts(); |
| 260 | static void HandleSigInterrupt(int); | 260 | static void HandleSigInterrupt(int); |
| 261 | void OnSigInterruptNotifierActivated(); | 261 | void OnSigInterruptNotifierActivated(); |
| @@ -435,7 +435,7 @@ private: | |||
| 435 | // True if TAS recording dialog is visible | 435 | // True if TAS recording dialog is visible |
| 436 | bool is_tas_recording_dialog_active{}; | 436 | bool is_tas_recording_dialog_active{}; |
| 437 | 437 | ||
| 438 | #ifdef __linux__ | 438 | #ifdef __unix__ |
| 439 | QSocketNotifier* sig_interrupt_notifier; | 439 | QSocketNotifier* sig_interrupt_notifier; |
| 440 | static std::array<int, 3> sig_interrupt_fds; | 440 | static std::array<int, 3> sig_interrupt_fds; |
| 441 | 441 | ||