Merge pull request #11465 from OatmealDome/qt6-xinput-bug

DolphinQt: Add workaround for Qt 6.3+ bug on Linux
This commit is contained in:
Admiral H. Curtiss 2023-01-24 06:21:19 +01:00 committed by GitHub
commit 7002831c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,10 @@
#include <cstdio> #include <cstdio>
#endif #endif
#ifdef __linux__
#include <cstdlib>
#endif
#include <OptionParser.h> #include <OptionParser.h>
#include <QAbstractEventDispatcher> #include <QAbstractEventDispatcher>
#include <QApplication> #include <QApplication>
@ -133,6 +137,16 @@ int main(int argc, char* argv[])
} }
#endif #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); auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
const std::vector<std::string> args = parser->args(); const std::vector<std::string> args = parser->args();