summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorOatmealDome <julian@oatmealdome.me>2023-01-20 02:50:39 -0500
committerOatmealDome <julian@oatmealdome.me>2023-01-20 03:06:04 -0500
commitd40dbe467040668a296ff488b47d99ccadae7dc5 (patch)
treece5693d0c78c67483fe3232ec7f5e22590e578de /Source/Core
parent1b333727e9c2b1d64b565a5a63f9d42e6577cd37 (diff)
DolphinQt: Add workaround for Qt 6.3+ bug on Linux
See https://bugs.dolphin-emu.org/issues/12913 for more information.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp
index 06a29081f6..849a5b5550 100644
--- a/Source/Core/DolphinQt/Main.cpp
+++ b/Source/Core/DolphinQt/Main.cpp
@@ -9,6 +9,10 @@
#include <cstdio>
#endif
+#ifdef __linux__
+#include <cstdlib>
+#endif
+
#include <OptionParser.h>
#include <QAbstractEventDispatcher>
#include <QApplication>
@@ -133,6 +137,16 @@ int main(int argc, char* argv[])
}
#endif
+#ifdef __linux__
+ // Qt 6.3+ has a bug which causes mouse inputs to not be registered in our XInput2 code.
+ // If we define QT_XCB_NO_XI2, Qt's xcb platform plugin no longer initializes its XInput
+ // code, which makes mouse inputs work again.
+ // For more information: https://bugs.dolphin-emu.org/issues/12913
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
+ putenv("QT_XCB_NO_XI2=1");
+#endif
+#endif
+
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
const std::vector<std::string> args = parser->args();