Commit afe0a5c0 authored by Martin Flöser's avatar Martin Flöser

Fix placement of KSplash

In a bug report there was a reference that on multi-screen KSplash is
not placed correctly. I investigated and noticed that it is an OSD which
sets an own position. In KWin the events were processed correctly but
the position was off.

The problem is that KWin has code to correct the position of an OSD when
it's size changes. This happens also on first damage and then the window
gets incorrectly placed when the position is set. So honor that the
position is set.

Test Plan: Restarted the session, ksplash positioned correctly now.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision:
parent 1e7b4fbc
......@@ -76,7 +76,7 @@ AbstractClient::AbstractClient()
connect(this, &AbstractClient::geometryShapeChanged, this,
[this] (Toplevel *c, const QRect &old) {
if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size()) {
if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) {
GeometryUpdatesBlocker blocker(this);
QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop());
Placement::self()->place(this, area);
......@@ -678,6 +678,10 @@ public:
bool unresponsive() const;
virtual bool isInitialPositionSet() const {
return false;
public Q_SLOTS:
virtual void closeWindow() = 0;
......@@ -57,6 +57,8 @@ private Q_SLOTS:
void testPanelWindowsCanCover_data();
void testPanelWindowsCanCover();
void testOSDPlacement();
void testOSDPlacementManualPosition_data();
void testOSDPlacementManualPosition();
void testPanelTypeHasStrut_data();
void testPanelTypeHasStrut();
void testPanelActivate_data();
......@@ -246,6 +248,40 @@ void PlasmaSurfaceTest::testOSDPlacement()
QCOMPARE(c->geometry(), QRect(540, 616, 200, 100));
void PlasmaSurfaceTest::testOSDPlacementManualPosition_data()
QTest::newRow("wl-shell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgv5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgv6") << Test::ShellSurfaceType::XdgShellV6;
void PlasmaSurfaceTest::testOSDPlacementManualPosition()
QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(;
plasmaSurface->setPosition(QPoint(50, 70));
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type,;
// now render and map the window
auto c = Test::renderAndWaitForShown(, QSize(100, 50), Qt::blue);
QCOMPARE(c->windowType(), NET::OnScreenDisplay);
QCOMPARE(c->geometry(), QRect(50, 70, 100, 50));
void PlasmaSurfaceTest::testPanelTypeHasStrut_data()
......@@ -137,7 +137,7 @@ public:
void installQtExtendedSurface(KWayland::Server::QtExtendedSurfaceInterface *surface);
void installServerSideDecoration(KWayland::Server::ServerSideDecorationInterface *decoration);
bool isInitialPositionSet() const;
bool isInitialPositionSet() const override;
bool isTransient() const override;
bool hasTransientPlacementHint() const override;
Markdown is supported
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