Commit c4a0d692 authored by Martin Flöser's avatar Martin Flöser
Browse files

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
parent 27854ca9
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment