|
@@ -2306,10 +2306,12 @@ static int run_program(fstream &logFile, int argc, char *argv[])
|
|
|
/* 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. */
|
|
|
+ * line option. Remove after Qt 6.3 is everywhere. */
|
|
|
|
|
|
+ const char *desktop = getenv("XDG_CURRENT_DESKTOP");
|
|
|
const char *session_type = getenv("XDG_SESSION_TYPE");
|
|
|
- if (session_type && strcmp(session_type, "wayland") == 0)
|
|
|
+ if (session_type && desktop && strcmp(desktop, "GNOME") == 0 &&
|
|
|
+ strcmp(session_type, "wayland") == 0)
|
|
|
setenv("QT_QPA_PLATFORM", "wayland", false);
|
|
|
#endif
|
|
|
#endif
|