From 340838c0ebd11dcf4ba54514e6fb446a9fda47fd Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:46:53 +0000 Subject: [PATCH 01/13] fix: checkStateChanged --- src/citron/applets/qt_controller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/citron/applets/qt_controller.cpp b/src/citron/applets/qt_controller.cpp index ab8a9cab2..97e96d90d 100644 --- a/src/citron/applets/qt_controller.cpp +++ b/src/citron/applets/qt_controller.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -184,7 +185,7 @@ QtControllerSelectorDialog::QtControllerSelectorDialog( CheckIfParametersMet(); }); - connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) { + connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) { player_groupboxes[i]->setChecked(state == Qt::Checked); UpdateControllerIcon(i); UpdateControllerState(i); From 6b019fc34dd47f361cd508719daac1e8451643cf Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:48:54 +0000 Subject: [PATCH 02/13] fix: checkStateChanged --- src/citron/configuration/configure_input_advanced.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/citron/configuration/configure_input_advanced.cpp b/src/citron/configuration/configure_input_advanced.cpp index 198719727..569a07232 100644 --- a/src/citron/configuration/configure_input_advanced.cpp +++ b/src/citron/configuration/configure_input_advanced.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -74,13 +75,13 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QW } } - connect(ui->mouse_enabled, &QCheckBox::stateChanged, this, + connect(ui->mouse_enabled, &QCheckBox::checkStateChanged, this, &ConfigureInputAdvanced::UpdateUIEnabled); - connect(ui->debug_enabled, &QCheckBox::stateChanged, this, + connect(ui->debug_enabled, &QCheckBox::checkStateChanged, this, &ConfigureInputAdvanced::UpdateUIEnabled); - connect(ui->touchscreen_enabled, &QCheckBox::stateChanged, this, + connect(ui->touchscreen_enabled, &QCheckBox::checkStateChanged, this, &ConfigureInputAdvanced::UpdateUIEnabled); - connect(ui->enable_ring_controller, &QCheckBox::stateChanged, this, + connect(ui->enable_ring_controller, &QCheckBox::checkStateChanged, this, &ConfigureInputAdvanced::UpdateUIEnabled); connect(ui->debug_configure, &QPushButton::clicked, this, From 325a1573623d37d8e1b791f4e5aef2208133a444 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:49:50 +0000 Subject: [PATCH 03/13] fix: checkStateChanged --- src/citron/configuration/configure_filesystem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/citron/configuration/configure_filesystem.cpp b/src/citron/configuration/configure_filesystem.cpp index 4b05562c7..a62c00201 100644 --- a/src/citron/configuration/configure_filesystem.cpp +++ b/src/citron/configuration/configure_filesystem.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -29,9 +30,9 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent) connect(ui->reset_game_list_cache, &QPushButton::pressed, this, &ConfigureFilesystem::ResetMetadata); - connect(ui->gamecard_inserted, &QCheckBox::stateChanged, this, + connect(ui->gamecard_inserted, &QCheckBox::checkStateChanged, this, &ConfigureFilesystem::UpdateEnabledControls); - connect(ui->gamecard_current_game, &QCheckBox::stateChanged, this, + connect(ui->gamecard_current_game, &QCheckBox::checkStateChanged, this, &ConfigureFilesystem::UpdateEnabledControls); } From 4cdf19f323f17ea3041e5c707202a51e6f9f7ec3 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:50:32 +0000 Subject: [PATCH 04/13] fix: checkStateChanged --- src/citron/configuration/configure_input.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/citron/configuration/configure_input.cpp b/src/citron/configuration/configure_input.cpp index 8b8850245..930bd88c4 100644 --- a/src/citron/configuration/configure_input.cpp +++ b/src/citron/configuration/configure_input.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: 2016 Citra Emulator Project +// SPDX-FileCopyrightText: 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -121,7 +122,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem, &ConfigureInput::UpdateAllInputDevices); connect(player_controllers[i], &ConfigureInputPlayer::RefreshInputProfiles, this, &ConfigureInput::UpdateAllInputProfiles, Qt::QueuedConnection); - connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) { + connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) { // Keep activated controllers synced with the "Connected Controllers" checkboxes player_controllers[i]->ConnectPlayer(state == Qt::Checked); }); From 944bfc3918c922f4ff65f35f9a811a6209ebe818 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:51:21 +0000 Subject: [PATCH 05/13] fix: configure_system.cpp --- src/citron/configuration/configure_system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citron/configuration/configure_system.cpp b/src/citron/configuration/configure_system.cpp index d50907fab..9693361af 100644 --- a/src/citron/configuration/configure_system.cpp +++ b/src/citron/configuration/configure_system.cpp @@ -85,7 +85,7 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, connect(combo_language, qOverload(&QComboBox::currentIndexChanged), this, locale_check); connect(combo_region, qOverload(&QComboBox::currentIndexChanged), this, locale_check); - connect(checkbox_rtc, qOverload(&QCheckBox::stateChanged), this, update_rtc_date); + connect(checkbox_rtc, &QCheckBox::checkStateChanged, this, update_rtc_date); connect(date_rtc_offset, qOverload(&QSpinBox::valueChanged), this, update_rtc_date); connect(date_rtc, &QDateTimeEdit::dateTimeChanged, this, update_date_offset); From 2a53da7b168f012d95d7fb0a3ef4ccec7db3370e Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:51:58 +0000 Subject: [PATCH 06/13] fix: checkStateChanged --- src/citron/configuration/shared_widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citron/configuration/shared_widget.cpp b/src/citron/configuration/shared_widget.cpp index 34c50d31e..4d4048145 100644 --- a/src/citron/configuration/shared_widget.cpp +++ b/src/citron/configuration/shared_widget.cpp @@ -708,7 +708,7 @@ void Widget::SetupComponent(const QString& label, std::function& load_fu restore_func(); } }; - connect(checkbox, &QCheckBox::stateChanged, reset); + connect(checkbox, &QCheckBox::checkStateChanged, reset); reset(checkbox->checkState()); } } From 101363c5eb19cfe576acc9631b0aa665a3d7d35a Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:52:32 +0000 Subject: [PATCH 07/13] fix: Qt::Vertical --- src/citron/bootmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/citron/bootmanager.cpp b/src/citron/bootmanager.cpp index 9f68f85bc..aedf3d660 100644 --- a/src/citron/bootmanager.cpp +++ b/src/citron/bootmanager.cpp @@ -998,7 +998,7 @@ void GRenderWindow::CaptureScreenshot(const QString& screenshot_path) { screenshot_image.bits(), [=, this](bool invert_y) { const std::string std_screenshot_path = screenshot_path.toStdString(); - if (screenshot_image.mirrored(false, invert_y).save(screenshot_path)) { + if ((invert_y ? screenshot_image.flipped(Qt::Vertical) : screenshot_image).save(screenshot_path)) { LOG_INFO(Frontend, "Screenshot saved to \"{}\"", std_screenshot_path); } else { LOG_ERROR(Frontend, "Failed to save screenshot to \"{}\"", std_screenshot_path); From 7b0b3f37d2bd827dfd0a0328bed6a0b3fd50d4ac Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:53:11 +0000 Subject: [PATCH 08/13] remove: Deprecated Value --- src/citron/main.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/citron/main.cpp b/src/citron/main.cpp index 98dc841e6..e69d8b95d 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -5440,10 +5440,6 @@ static void SetHighDPIAttributes() { Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif - // Enable high DPI scaling and pixmaps - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - // Set the DPI awareness for better scaling on Windows #ifdef _WIN32 // Enable Per Monitor DPI Awareness for Windows 8.1+ From 0c2502f3fc16ec161ca7126d087f69796bfac017 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:54:08 +0000 Subject: [PATCH 09/13] fix: disable Warnings --- src/common/string_util.cpp | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 1909aced5..155e3b49a 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project // SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-FileCopyrightText: 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -141,21 +142,63 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st return result; } +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + std::string UTF16ToUTF8(std::u16string_view input) { std::wstring_convert, char16_t> convert; return convert.to_bytes(input.data(), input.data() + input.size()); } +#if defined(_MSC_VER) +#pragma warning(pop) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + std::u16string UTF8ToUTF16(std::string_view input) { std::wstring_convert, char16_t> convert; return convert.from_bytes(input.data(), input.data() + input.size()); } +#if defined(_MSC_VER) +#pragma warning(pop) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4996) // 'std::wstring_convert': was declared deprecated +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + std::u32string UTF8ToUTF32(std::string_view input) { std::wstring_convert, char32_t> convert; return convert.from_bytes(input.data(), input.data() + input.size()); } +#if defined(_MSC_VER) +#pragma warning(pop) +#elif defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + #ifdef _WIN32 static std::wstring CPToUTF16(u32 code_page, std::string_view input) { const auto size = From 89300b17bf1ae88dfe98a49192f5cf4a78243e8a Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 06:55:53 +0000 Subject: [PATCH 10/13] fix: remove -p0 from Clang & rapidjson --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 206e4a2b3..382fb8a33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -399,7 +399,7 @@ if(USE_DISCORD_PRESENCE) # Check if the target directory exists before trying to patch if(EXISTS "${PATCH_TARGET_DIR}") execute_process( - COMMAND git apply -p0 --ignore-whitespace "${PATCH_FILE}" + COMMAND git apply --ignore-whitespace "${PATCH_FILE}" WORKING_DIRECTORY "${PATCH_TARGET_DIR}" RESULT_VARIABLE PATCH_RESULT OUTPUT_QUIET @@ -422,7 +422,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(EXISTS "${MCL_PATCH_TARGET_DIR}") execute_process( - COMMAND git apply -p0 --ignore-whitespace "${MCL_PATCH_FILE}" + COMMAND git apply --ignore-whitespace "${MCL_PATCH_FILE}" WORKING_DIRECTORY "${MCL_PATCH_TARGET_DIR}" RESULT_VARIABLE MCL_PATCH_RESULT OUTPUT_QUIET From 3e11537f387d2639805d537b12bb05ff4a27ac09 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 07:19:10 +0000 Subject: [PATCH 11/13] add: Discord-RPC warning patch --- CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 382fb8a33..ead72f340 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -461,6 +461,30 @@ else() message(WARNING "Could not find stb_image.h to patch. It may not have been downloaded yet.") endif() +# Apply a patch to discord-rpc's CMakeLists.txt to suppress -Wclass-memaccess +message(STATUS "Applying custom patch to submodule's discord-rpc CMakeLists.txt...") + +# Define the path to the patch file and the target directory using unique names +set(DISCORD_RPC_PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patches/discord-rpc-wclass-memaccess-fix.patch") +set(DISCORD_RPC_PATCH_TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/discord-rpc") + +# Check if the target directory exists before trying to patch +if(EXISTS "${DISCORD_RPC_PATCH_TARGET_DIR}") + execute_process( + COMMAND git apply --ignore-whitespace "${DISCORD_RPC_PATCH_FILE}" + WORKING_DIRECTORY "${DISCORD_RPC_PATCH_TARGET_DIR}" + RESULT_VARIABLE PATCH_RESULT + OUTPUT_QUIET + ERROR_QUIET + ) + + if(NOT PATCH_RESULT EQUAL 0) + message(WARNING "Failed to apply discord-rpc CMakeLists.txt patch! This might be okay if it's already applied.") + endif() +else() + message(WARNING "Could not find discord-rpc directory to patch. It may not have been downloaded yet.") +endif() + if (ENABLE_QT) if (NOT USE_SYSTEM_QT) download_qt(6.7.3) From 781d21ec7b4bda4d378864432803abecfd628283 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 07:24:32 +0000 Subject: [PATCH 12/13] add: Discord-RPC wclass memaccess Patch --- patches/discord-rpc-wclass-memaccess-fix.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 patches/discord-rpc-wclass-memaccess-fix.patch diff --git a/patches/discord-rpc-wclass-memaccess-fix.patch b/patches/discord-rpc-wclass-memaccess-fix.patch new file mode 100644 index 000000000..e640611cf --- /dev/null +++ b/patches/discord-rpc-wclass-memaccess-fix.patch @@ -0,0 +1,18 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 5dad9e9..972183d 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -51,6 +51,13 @@ add_library(rapidjson STATIC IMPORTED ${RAPIDJSON}) + # add subdirs + + add_subdirectory(src) ++ ++# Suppress the -Wclass-memaccess warning from modern GCC/Clang in rapidjson. ++# This warning flags intentional, performance-oriented code in the library. ++if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") ++ target_compile_options(discord-rpc PRIVATE "-Wno-class-memaccess") ++endif() ++ + if (BUILD_EXAMPLES) + add_subdirectory(examples/send-presence) + endif(BUILD_EXAMPLES) From 72d6f9448b55bab62610ab5f420566cfd32da615 Mon Sep 17 00:00:00 2001 From: collecting Date: Tue, 7 Oct 2025 07:31:38 +0000 Subject: [PATCH 13/13] add: -p0 to discord-rpc patch --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ead72f340..08e697bc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -471,7 +471,7 @@ set(DISCORD_RPC_PATCH_TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/discord- # Check if the target directory exists before trying to patch if(EXISTS "${DISCORD_RPC_PATCH_TARGET_DIR}") execute_process( - COMMAND git apply --ignore-whitespace "${DISCORD_RPC_PATCH_FILE}" + COMMAND git apply -p0 --ignore-whitespace "${DISCORD_RPC_PATCH_FILE}" WORKING_DIRECTORY "${DISCORD_RPC_PATCH_TARGET_DIR}" RESULT_VARIABLE PATCH_RESULT OUTPUT_QUIET