No longer export QT_QPA_PLATFORM env variable to the session

Summary:
As discussed the env variables are no longer exported. Thus Qt
applications follow the default qpa platform they are compiled with and
thus still function if they are packaged with a Qt without QtWayland.
Plasma's internal processes pick the qpa platform depending on the
session type as well as our flatpak apps.

KRunner and Plasmashell are adjusted to not leak the env variable they
set for themselves.

Test Plan:
Started a wayland session, verified with KWin's debug console
that plasmashell and krunner are wayland. Launched kwrite from both plasma
and krunner and verified that it's xcb

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11447
wilder-5.14
Martin Flöser 8 years ago
parent 27854ca9f4
commit c4a0d6925e
  1. 5
      krunner/main.cpp
  2. 5
      shell/main.cpp
  3. 4
      startkde/startplasmacompositor.cmake

@ -44,9 +44,14 @@ int main(int argc, char **argv)
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();

@ -59,8 +59,13 @@ int main(int argc, char *argv[])
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.

@ -218,10 +218,6 @@ export KDE_SESSION_UID
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

Loading…
Cancel
Save