UI: Force Wayland usage under Wayland session
Qt doesn't use the Wayland platform on GNOME, so we have to force it using the QT_QPA_PLATFORM env var. It's still possible to use other QPA platforms using this env var, or the -platform command line option. qt5-wayland is now a required dependency for OBS on Linux (or FreeBSD). Co-authored-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
This commit is contained in:
parent
fb7a037bc8
commit
47df2467e9
@ -2009,6 +2009,18 @@ static int run_program(fstream &logFile, int argc, char *argv[])
|
|||||||
InstallNSApplicationSubclass();
|
InstallNSApplicationSubclass();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(_WIN32) && !defined(__APPLE__) && defined(USE_XDG) && \
|
||||||
|
defined(ENABLE_WAYLAND)
|
||||||
|
/* NOTE: Qt doesn't use the Wayland platform on GNOME, so we have to
|
||||||
|
* force it using the QT_QPA_PLATFORM env var. It's still possible to
|
||||||
|
* use other QPA platforms using this env var, or the -platform command
|
||||||
|
* line option. */
|
||||||
|
|
||||||
|
const char *session_type = getenv("XDG_SESSION_TYPE");
|
||||||
|
if (session_type && strcmp(session_type, "wayland") == 0)
|
||||||
|
setenv("QT_QPA_PLATFORM", "wayland", false);
|
||||||
|
#endif
|
||||||
|
|
||||||
OBSApp program(argc, argv, profilerNameStore.get());
|
OBSApp program(argc, argv, profilerNameStore.get());
|
||||||
try {
|
try {
|
||||||
QAccessible::installFactory(accessibleFactory);
|
QAccessible::installFactory(accessibleFactory);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user