From 805495c8ea8ec291f6d907663b1e645250cc8085 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 26 Oct 2012 16:18:16 +0200 Subject: [PATCH] do not resume compositing when it's suspended and a client blocks it REVIEW: 106900 CCBUG: 308438 --- composite.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/composite.cpp b/composite.cpp index 6ed8289bd8..f862f72e03 100644 --- a/composite.cpp +++ b/composite.cpp @@ -304,7 +304,7 @@ void Workspace::updateCompositeBlocking(Client *c) if (c) { // if c == 0 we just check if we can resume if (c->isBlockingCompositing()) { if (!compositingBlocked) // do NOT attempt to call suspendCompositing(true); from within the eventchain! - QMetaObject::invokeMethod(this, "slotToggleCompositing", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "suspendCompositing", Qt::QueuedConnection, Q_ARG(bool, true)); compositingBlocked = true; } } @@ -320,8 +320,7 @@ void Workspace::updateCompositeBlocking(Client *c) } if (resume) { // do NOT attempt to call suspendCompositing(false); from within the eventchain! compositingBlocked = false; - if (compositingSuspended) - QMetaObject::invokeMethod(this, "slotToggleCompositing", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "suspendCompositing", Qt::QueuedConnection, Q_ARG(bool, false)); } } } @@ -333,6 +332,10 @@ void Workspace::suspendCompositing() void Workspace::suspendCompositing(bool suspend) { + if (compositingSuspended == suspend) { + // nothing actually changes + return; + } compositingSuspended = suspend; finishCompositing(); setupCompositing(); // will do nothing if suspended