diff --git a/client.cpp b/client.cpp index acc98f730e..19f2b4ef81 100644 --- a/client.cpp +++ b/client.cpp @@ -2383,9 +2383,13 @@ xcb_window_t Client::frameId() const return m_frame; } -void Client::updateShowOnScreenEdge() +Xcb::Property Client::fetchShowOnScreenEdge() const +{ + return Xcb::Property(false, window(), atoms->kde_screen_edge_show, XCB_ATOM_CARDINAL, 0, 1); +} + +void Client::readShowOnScreenEdge(Xcb::Property &property) { - Xcb::Property property(false, window(), atoms->kde_screen_edge_show, XCB_ATOM_CARDINAL, 0, 1); const uint32_t value = property.value(ElectricNone); ElectricBorder border = ElectricNone; switch (value) { @@ -2417,6 +2421,12 @@ void Client::updateShowOnScreenEdge() } } +void Client::updateShowOnScreenEdge() +{ + Xcb::Property property = fetchShowOnScreenEdge(); + readShowOnScreenEdge(property); +} + void Client::showOnScreenEdge() { hideClient(false); diff --git a/client.h b/client.h index 13ff89b5c1..d8726ec2f9 100644 --- a/client.h +++ b/client.h @@ -890,6 +890,8 @@ private: bool tabTo(Client *other, bool behind, bool activate); + Xcb::Property fetchShowOnScreenEdge() const; + void readShowOnScreenEdge(Xcb::Property &property); /** * Reads the property and creates/destroys the screen edge if required * and shows/hides the client. diff --git a/manage.cpp b/manage.cpp index dc5a392788..5a3f3f85ba 100644 --- a/manage.cpp +++ b/manage.cpp @@ -100,6 +100,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) auto wmClientLeaderCookie = fetchWmClientLeader(); auto skipCloseAnimationCookie = fetchSkipCloseAnimation(); auto gtkFrameExtentsCookie = fetchGtkFrameExtents(); + auto showOnScreenEdgeCookie = fetchShowOnScreenEdge(); info = new WinInfo(this, m_client, rootWindow(), properties, properties2); // If it's already mapped, ignore hint @@ -635,7 +636,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) setBlockingCompositing(info->isBlockingCompositing()); updateColorScheme(); - updateShowOnScreenEdge(); + readShowOnScreenEdge(showOnScreenEdgeCookie); // TODO: there's a small problem here - isManaged() depends on the mapping state, // but this client is not yet in Workspace's client list at this point, will