diff --git a/client.cpp b/client.cpp index acbe49249d..d1725b7612 100644 --- a/client.cpp +++ b/client.cpp @@ -413,6 +413,7 @@ void Client::createDecoration(const QRect& oldgeom) connect(m_decoration, &KDecoration2::Decoration::resizeOnlyBordersChanged, this, &Client::updateInputWindow); connect(m_decoration, &KDecoration2::Decoration::bordersChanged, this, [this]() { + updateFrameExtents(); GeometryUpdatesBlocker blocker(this); // TODO: this is obviously idempotent // calculateGravitation(true) would have to operate on the old border sizes diff --git a/screenedge.cpp b/screenedge.cpp index d2fe46cf05..35d84a04eb 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -1077,9 +1077,11 @@ void ScreenEdges::unreserve(ElectricBorder border, QObject *object) void ScreenEdges::reserve(Client *client, ElectricBorder border) { + bool hadBorder = false; auto it = m_edges.begin(); while (it != m_edges.end()) { if ((*it)->client() == client) { + hadBorder = true; if ((*it)->border() == border) { if (client->isHiddenInternal() && !(*it)->isReserved()) { (*it)->reserve(); @@ -1093,9 +1095,15 @@ void ScreenEdges::reserve(Client *client, ElectricBorder border) it++; } } - createEdgeForClient(client, border); - connect(client, &Client::geometryChanged, this, &ScreenEdges::handleClientGeometryChanged); + if (border != ElectricNone) { + connect(client, &Client::geometryChanged, this, &ScreenEdges::handleClientGeometryChanged, Qt::UniqueConnection); + createEdgeForClient(client, border); + } else { + disconnect(client, &Client::geometryChanged, this, &ScreenEdges::handleClientGeometryChanged); + if (hadBorder) // show again + client->showOnScreenEdge(); + } } void ScreenEdges::createEdgeForClient(Client *client, ElectricBorder border) diff --git a/tabbox/switcheritem.cpp b/tabbox/switcheritem.cpp index f463027ae0..47a33e5cfb 100644 --- a/tabbox/switcheritem.cpp +++ b/tabbox/switcheritem.cpp @@ -43,7 +43,6 @@ SwitcherItem::SwitcherItem(QObject *parent) } }); connect(screens(), &Screens::changed, this, &SwitcherItem::screenGeometryChanged); - connect(screens(), &Screens::currentChanged, this, &SwitcherItem::screenGeometryChanged); } SwitcherItem::~SwitcherItem() @@ -71,6 +70,8 @@ void SwitcherItem::setVisible(bool visible) if (m_visible == visible) { return; } + if (visible) + emit screenGeometryChanged(); m_visible = visible; emit visibleChanged(); }