Export blocking compositing as a Client's Q_PROPERTY
Allows to block compositing on Client's from scripts. Usecase: window rule cannot properly identify buggy clients and scripting allows to just act on fullscreen windows. BUG: 297146 FIXED-IN: 4.9.0 REVIEW: 104448icc-effect-5.14.5
parent
cd8a18080f
commit
cdc1af7df1
15
client.cpp
15
client.cpp
|
@ -2312,16 +2312,23 @@ void Client::updateCursor()
|
|||
|
||||
void Client::updateCompositeBlocking(bool readProperty)
|
||||
{
|
||||
const bool usedToBlock = blocks_compositing;
|
||||
if (readProperty) {
|
||||
const unsigned long properties[2] = {0, NET::WM2BlockCompositing};
|
||||
NETWinInfo2 i(QX11Info::display(), window(), rootWindow(), properties, 2);
|
||||
blocks_compositing = rules()->checkBlockCompositing(i.isBlockingCompositing());
|
||||
setBlockingCompositing(i.isBlockingCompositing());
|
||||
}
|
||||
else
|
||||
blocks_compositing = rules()->checkBlockCompositing(blocks_compositing);
|
||||
if (usedToBlock != blocks_compositing)
|
||||
setBlockingCompositing(blocks_compositing);
|
||||
}
|
||||
|
||||
void Client::setBlockingCompositing(bool block)
|
||||
{
|
||||
const bool usedToBlock = blocks_compositing;
|
||||
blocks_compositing = rules()->checkBlockCompositing(block);
|
||||
if (usedToBlock != blocks_compositing) {
|
||||
workspace()->updateCompositeBlocking(blocks_compositing ? this : 0);
|
||||
emit blockingCompositingChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Client::Position Client::mousePosition(const QPoint& p) const
|
||||
|
|
16
client.h
16
client.h
|
@ -259,6 +259,17 @@ class Client
|
|||
* (usually, that it got activated).
|
||||
**/
|
||||
Q_PROPERTY(bool demandsAttention READ isDemandingAttention WRITE demandAttention NOTIFY demandsAttentionChanged)
|
||||
/**
|
||||
* A client can block compositing. That is while the Client is alive and the state is set,
|
||||
* Compositing is suspended and is resumed when there are no Clients blocking compositing any
|
||||
* more.
|
||||
*
|
||||
* This is actually set by a window property, unfortunately not used by the target application
|
||||
* group. For convenience it's exported as a property to the scripts.
|
||||
*
|
||||
* Use with care!
|
||||
**/
|
||||
Q_PROPERTY(bool blocksCompositing READ isBlockingCompositing WRITE setBlockingCompositing NOTIFY blockingCompositingChanged)
|
||||
public:
|
||||
Client(Workspace* ws);
|
||||
Window wrapperId() const;
|
||||
|
@ -472,6 +483,7 @@ public:
|
|||
|
||||
virtual void setupCompositing();
|
||||
virtual void finishCompositing();
|
||||
void setBlockingCompositing(bool block);
|
||||
inline bool isBlockingCompositing() { return blocks_compositing; }
|
||||
void updateCompositeBlocking(bool readProperty = false);
|
||||
|
||||
|
@ -705,6 +717,10 @@ signals:
|
|||
* Emitted whenever the demands attention state changes.
|
||||
**/
|
||||
void demandsAttentionChanged();
|
||||
/**
|
||||
* Emitted whenever the Client's block compositing state changes.
|
||||
**/
|
||||
void blockingCompositingChanged();
|
||||
|
||||
private:
|
||||
void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1
|
||||
|
|
Loading…
Reference in New Issue