Use NETWM to get updates on blocking compositing
Adds NET::WM2BlockCompositing to the Client's properties which allows to read the state from the NETWinInfo object and get updates without having to resolve the atom ourselve. REVIEW: 117561
This commit is contained in:
parent
c63e3533f4
commit
fd0fd82ad6
6 changed files with 5 additions and 16 deletions
|
@ -51,7 +51,6 @@ Atoms::Atoms()
|
|||
, kde_net_wm_frame_strut(QByteArrayLiteral("_KDE_NET_WM_FRAME_STRUT"))
|
||||
, net_wm_sync_request_counter(QByteArrayLiteral("_NET_WM_SYNC_REQUEST_COUNTER"))
|
||||
, net_wm_sync_request(QByteArrayLiteral("_NET_WM_SYNC_REQUEST"))
|
||||
, kde_net_wm_block_compositing(QByteArrayLiteral("_KDE_NET_WM_BLOCK_COMPOSITING"))
|
||||
, kde_net_wm_shadow(QByteArrayLiteral("_KDE_NET_WM_SHADOW"))
|
||||
, net_wm_opaque_region(QByteArrayLiteral("_NET_WM_OPAQUE_REGION"))
|
||||
, kde_net_wm_tab_group(QByteArrayLiteral("_KDE_NET_WM_TAB_GROUP"))
|
||||
|
|
1
atoms.h
1
atoms.h
|
@ -60,7 +60,6 @@ public:
|
|||
Xcb::Atom kde_net_wm_frame_strut;
|
||||
Xcb::Atom net_wm_sync_request_counter;
|
||||
Xcb::Atom net_wm_sync_request;
|
||||
Xcb::Atom kde_net_wm_block_compositing;
|
||||
Xcb::Atom kde_net_wm_shadow;
|
||||
Xcb::Atom net_wm_opaque_region;
|
||||
Xcb::Atom kde_net_wm_tab_group;
|
||||
|
|
10
client.cpp
10
client.cpp
|
@ -2318,16 +2318,6 @@ void Client::updateCursor()
|
|||
}
|
||||
}
|
||||
|
||||
void Client::updateCompositeBlocking(bool readProperty)
|
||||
{
|
||||
if (readProperty) {
|
||||
NETWinInfo i(connection(), window(), rootWindow(), 0, NET::WM2BlockCompositing);
|
||||
setBlockingCompositing(i.isBlockingCompositing());
|
||||
}
|
||||
else
|
||||
setBlockingCompositing(blocks_compositing);
|
||||
}
|
||||
|
||||
void Client::setBlockingCompositing(bool block)
|
||||
{
|
||||
const bool usedToBlock = blocks_compositing;
|
||||
|
|
1
client.h
1
client.h
|
@ -493,7 +493,6 @@ public:
|
|||
virtual void finishCompositing();
|
||||
void setBlockingCompositing(bool block);
|
||||
inline bool isBlockingCompositing() { return blocks_compositing; }
|
||||
void updateCompositeBlocking(bool readProperty = false);
|
||||
|
||||
QString caption(bool full = true, bool stripped = false) const;
|
||||
|
||||
|
|
|
@ -526,6 +526,9 @@ bool Client::windowEvent(xcb_generic_event_t *e)
|
|||
if (dirtyProperties2.testFlag(NET::WM2WindowClass)) {
|
||||
getResourceClass();
|
||||
}
|
||||
if (dirtyProperties2.testFlag(NET::WM2BlockCompositing)) {
|
||||
setBlockingCompositing(info->isBlockingCompositing());
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t eventType = e->response_type & ~0x80;
|
||||
|
@ -805,8 +808,6 @@ void Client::propertyNotifyEvent(xcb_property_notify_event_t *e)
|
|||
getSyncCounter();
|
||||
else if (e->atom == atoms->activities)
|
||||
checkActivities();
|
||||
else if (e->atom == atoms->kde_net_wm_block_compositing)
|
||||
updateCompositeBlocking(true);
|
||||
else if (e->atom == atoms->kde_first_in_window_list)
|
||||
updateFirstInTabBox();
|
||||
else if (e->atom == atoms->kde_color_sheme)
|
||||
|
|
|
@ -91,6 +91,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
|||
NET::WMPid |
|
||||
NET::WMIconName;
|
||||
const NET::Properties2 properties2 =
|
||||
NET::WM2BlockCompositing |
|
||||
NET::WM2WindowClass |
|
||||
NET::WM2WindowRole |
|
||||
NET::WM2UserTime |
|
||||
|
@ -618,7 +619,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
|||
RuleBook::self()->discardUsed(this, false); // Remove ApplyNow rules
|
||||
updateWindowRules(Rules::All); // Was blocked while !isManaged()
|
||||
|
||||
updateCompositeBlocking(true);
|
||||
setBlockingCompositing(info->isBlockingCompositing());
|
||||
updateColorScheme();
|
||||
updateShowOnScreenEdge();
|
||||
|
||||
|
|
Loading…
Reference in a new issue