UI: Enforce Fusion Qt style on Linux

The Breeze Qt style plugin adds frame arround QDockWidget with QPainter
which can not be modifed. To avoid this the base style is enforce to the
Qt default style on Linux: Fusion.
This commit is contained in:
tytan652 2022-06-27 18:34:33 +02:00 committed by Matt Gajownik
parent 1766f01b7a
commit 6d06052c51

View file

@ -2078,8 +2078,14 @@ static int run_program(fstream &logFile, int argc, char *argv[])
}
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && defined(USE_XDG) && \
defined(ENABLE_WAYLAND)
#if !defined(_WIN32) && !defined(__APPLE__)
/* NOTE: The Breeze Qt style plugin adds frame arround QDockWidget with
* QPainter which can not be modifed. To avoid this the base style is
* enforce to the Qt default style on Linux: Fusion. */
setenv("QT_STYLE_OVERRIDE", "Fusion", false);
#if defined(ENABLE_WAYLAND) && defined(USE_XDG)
/* 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
@ -2088,6 +2094,7 @@ static int run_program(fstream &logFile, int argc, char *argv[])
const char *session_type = getenv("XDG_SESSION_TYPE");
if (session_type && strcmp(session_type, "wayland") == 0)
setenv("QT_QPA_PLATFORM", "wayland", false);
#endif
#endif
OBSApp program(argc, argv, profilerNameStore.get());