From 834c15e717cc921177f96c9c0fe3df291d465b90 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 18 Aug 2024 03:10:29 +0200 Subject: [PATCH] UI: Remove legacy Qt workarounds (Ubuntu 22.04) --- UI/obs-app.cpp | 14 -------------- UI/window-basic-main.cpp | 9 +-------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 0db4a9293..aea7b0270 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1995,20 +1995,6 @@ static int run_program(fstream &logFile, int argc, char *argv[]) const char *platform_theme = getenv("QT_QPA_PLATFORMTHEME"); if (platform_theme && strcmp(platform_theme, "qt5ct") == 0) unsetenv("QT_QPA_PLATFORMTHEME"); - -#if defined(ENABLE_WAYLAND) && defined(USE_XDG) && \ - QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - /* 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. 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 && desktop && strstr(desktop, "GNOME") != nullptr && - strcmp(session_type, "wayland") == 0) - setenv("QT_QPA_PLATFORM", "wayland", false); -#endif #endif /* NOTE: This disables an optimisation in Qt that attempts to determine if diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 4d22e31ef..623c4021b 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -3787,14 +3787,7 @@ void OBSBasic::HideAudioControl() if (!SourceMixerHidden(source)) { SetSourceMixerHidden(source, true); - - /* Due to a bug with QT 6.2.4, the version that's in the Ubuntu - * 22.04 ppa, hiding the audio mixer causes a crash, so defer to - * the next event loop to hide it. Doesn't seem to be a problem - * with newer versions of QT. */ - QMetaObject::invokeMethod(this, "DeactivateAudioSource", - Qt::QueuedConnection, - Q_ARG(OBSSource, OBSSource(source))); + DeactivateAudioSource(source); } }