Split Client::updateShowOnScreenEdge into two parts
This commit is contained in:
parent
24688f8dae
commit
a55c7ba0d5
3 changed files with 16 additions and 3 deletions
14
client.cpp
14
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<uint32_t>(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);
|
||||
|
|
2
client.h
2
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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue