diff --git a/client.cpp b/client.cpp --- a/client.cpp +++ b/client.cpp @@ -34,6 +34,7 @@ #include "shadow.h" #include "workspace.h" #include "screenedge.h" +#include "screens.h" #include "decorations/decorationbridge.h" #include "decorations/decoratedclient.h" #include @@ -2081,7 +2082,36 @@ hideClient(true); successfullyHidden = isHiddenInternal(); - m_edgeRemoveConnection = connect(this, &Client::geometryChanged, this, [this](){ + m_edgeRemoveConnection = connect(this, &Client::geometryChanged, this, [this, border](){ + const auto &screenGeometry = screens()->geometry(screen()); + + switch (border) { + case ElectricTop: + if (geometry().top() == screenGeometry.top()) { + return; + } + break; + case ElectricRight: + if (geometry().right() == screenGeometry.right()) { + return; + } + break; + case ElectricBottom: + if (geometry().bottom() == screenGeometry.bottom()) { + return; + } + break; + case ElectricLeft: + if (geometry().left() == screenGeometry.left()) { + return; + } + break; + default: + break; + } + + // we're no longer at a screen edge which would make this client inaccessible, + // better reset the showOnScreenEdge state. ScreenEdges::self()->reserve(this, ElectricNone); }); }