Disable toplevel fixed positions on Wayland

Given that the wayland protocol does not have window positions a recent
change to Qt development branch avoids having a mismatch of positions
and tells client code the window is at the topleft of the screen. This
fixes multiple bugs.

Unfortunately this breaks a few usages within plasma where a
side-channel sends that absolute positional information over a bespoke
protocol. Currently we proxy this all through QWindow geometry where the
new Qt behaviour will throw is askew.

Whilst our longterm plans are to find future options away from the
plasmashell protocol we may as well have our Qt6
build work given the patch is trivial and harmless.

It also allows for potential backporting if our software is
already secured against issues. Hence the cherry-pick.
wilder-5.26
David Edmundson 4 years ago
parent 8e7c9dbe5c
commit e87d29c2a3
  1. 2
      krunner/main.cpp
  2. 3
      shell/main.cpp

@ -34,6 +34,7 @@ int main(int argc, char **argv)
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
} }
qputenv("QT_WAYLAND_DISABLE_FIXED_POSITIONS", {});
const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM");
KWorkSpace::detectPlatform(argc, argv); KWorkSpace::detectPlatform(argc, argv);
QQuickWindow::setDefaultAlphaBuffer(true); QQuickWindow::setDefaultAlphaBuffer(true);
@ -42,6 +43,7 @@ int main(int argc, char **argv)
// don't leak the env variable to processes we start // don't leak the env variable to processes we start
qunsetenv("QT_QPA_PLATFORM"); qunsetenv("QT_QPA_PLATFORM");
} }
qunsetenv("QT_WAYLAND_DISABLE_FIXED_POSITIONS");
KLocalizedString::setApplicationDomain("krunner"); KLocalizedString::setApplicationDomain("krunner");
// TODO: Make it a QGuiApplication once we don't depend on KDELibs4Support // TODO: Make it a QGuiApplication once we don't depend on KDELibs4Support

@ -79,6 +79,7 @@ int main(int argc, char *argv[])
oldCategoryFilter = QLoggingCategory::installFilter(filterConnectionSyntaxWarning); oldCategoryFilter = QLoggingCategory::installFilter(filterConnectionSyntaxWarning);
qputenv("QT_WAYLAND_DISABLE_FIXED_POSITIONS", {});
const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM"); const bool qpaVariable = qEnvironmentVariableIsSet("QT_QPA_PLATFORM");
KWorkSpace::detectPlatform(argc, argv); KWorkSpace::detectPlatform(argc, argv);
QApplication app(argc, argv); QApplication app(argc, argv);
@ -86,6 +87,8 @@ int main(int argc, char *argv[])
// don't leak the env variable to processes we start // don't leak the env variable to processes we start
qunsetenv("QT_QPA_PLATFORM"); qunsetenv("QT_QPA_PLATFORM");
} }
qunsetenv("QT_WAYLAND_DISABLE_FIXED_POSITIONS");
KLocalizedString::setApplicationDomain("plasmashell"); KLocalizedString::setApplicationDomain("plasmashell");
// The executable's path is added to the library/plugin paths. // The executable's path is added to the library/plugin paths.

Loading…
Cancel
Save