From fa774230f3f786e79e4b11ddf90778ccd890c07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 3 Mar 2016 13:36:01 +0100 Subject: [PATCH] Fix transient placement for decorated parents Need to add client pos to the transient's position. The offset is relative to the parent surface, but the client doesn't know about the size of the decoration, thus KWin needs to add it. --- autotests/wayland/transient_placement.cpp | 1 - placement.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/autotests/wayland/transient_placement.cpp b/autotests/wayland/transient_placement.cpp index a8cc736b4f..9e6d8fd5aa 100644 --- a/autotests/wayland/transient_placement.cpp +++ b/autotests/wayland/transient_placement.cpp @@ -297,7 +297,6 @@ void TransientPlacementTest::testDecorationPosition() QVERIFY(transient->hasTransientPlacementHint()); QFETCH(QRect, expectedGeometry); expectedGeometry.translate(parent->clientPos()); - QEXPECT_FAIL("", "Fix me", Continue); QCOMPARE(transient->geometry(), expectedGeometry); } diff --git a/placement.cpp b/placement.cpp index da8121aeb7..18521d25f7 100644 --- a/placement.cpp +++ b/placement.cpp @@ -497,7 +497,7 @@ void Placement::placeOnScreenDisplay(AbstractClient* c, QRect& area) void Placement::placeTransient(AbstractClient *c) { // TODO: apply sanity checks? - c->move(c->transientFor()->pos() + c->transientPlacementHint()); + c->move(c->transientFor()->pos() + c->transientFor()->clientPos() + c->transientPlacementHint()); } void Placement::placeDialog(AbstractClient* c, QRect& area, Policy nextPlacement)