diff --git a/krunner/main.cpp b/krunner/main.cpp --- a/krunner/main.cpp +++ b/krunner/main.cpp @@ -44,9 +44,14 @@ qunsetenv("QT_DEVICE_PIXEL_RATIO"); QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); KWorkSpace::detectPlatform(argc, argv); QQuickWindow::setDefaultAlphaBuffer(true); QApplication app(argc, argv); + if (!qpaVariable) { + // don't leak the env variable to processes we start + qunsetenv("QT_QPA_PLATFORM"); + } KLocalizedString::setApplicationDomain("krunner"); KQuickAddons::QtQuickSettings::init(); diff --git a/shell/main.cpp b/shell/main.cpp --- a/shell/main.cpp +++ b/shell/main.cpp @@ -59,8 +59,13 @@ QQuickWindow::setDefaultAlphaBuffer(true); + const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); KWorkSpace::detectPlatform(argc, argv); QApplication app(argc, argv); + if (!qpaVariable) { + // don't leak the env variable to processes we start + qunsetenv("QT_QPA_PLATFORM"); + } KLocalizedString::setApplicationDomain("plasmashell"); // The executable's path is added to the library/plugin paths. diff --git a/startkde/startplasmacompositor.cmake b/startkde/startplasmacompositor.cmake --- a/startkde/startplasmacompositor.cmake +++ b/startkde/startplasmacompositor.cmake @@ -218,10 +218,6 @@ XDG_CURRENT_DESKTOP=KDE export XDG_CURRENT_DESKTOP -#enforce wayland QPA -QT_QPA_PLATFORM=wayland -export QT_QPA_PLATFORM - # kwin_wayland can possibly also start dbus-activated services which need env variables. # In that case, the update in startplasma might be too late. if which dbus-update-activation-environment >/dev/null 2>/dev/null ; then