From ede337ff225852e0c69c4e4d36ae4603f707bc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 15 Aug 2015 01:26:55 +0200 Subject: [PATCH 1/3] udpate _NET_FRAME_EXTENTS with border updates BUG: 351157 FIXED-IN: 5.4 REVIEW: 124741 --- client.cpp | 1 + 1 file changed, 1 insertion(+) 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 From f96836b2df46e94dff52d0b26f7b6b01c4cec2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 19 Aug 2015 08:08:39 +0200 Subject: [PATCH 2/3] update SwitcherItem::screenGeometry when showing not everytime the current screen changes. a) that pollutes the geometry when the tabbox is invoked b) it's insufficient for "Active Screen follows mouse" (the default) c) less overhead (ok: "on multiscreen") BUG: 337790 CCBUG: 341531 FIXED-IN: 5.4 REVIEW: 124814 --- tabbox/switcheritem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } 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 3/3] 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)