From b7bb7222f4799bdbd337d736042266e94ca04a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 19 Aug 2015 11:24:22 +0200 Subject: [PATCH] do not call showOnScreenEdge for *all* clients when managing them or they change their geometry what will (aside the overehad) randomly show them on screen REVIEW: 124814 --- screenedge.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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)