Merge branch 'Plasma/5.17'
This commit is contained in:
commit
11502b7928
3 changed files with 17 additions and 12 deletions
|
@ -886,7 +886,6 @@ X11Compositor::X11Compositor(QObject *parent)
|
|||
, m_suspended(options->isUseCompositing() ? NoReasonSuspend : UserSuspend)
|
||||
, m_xrrRefreshRate(0)
|
||||
{
|
||||
qRegisterMetaType<X11Compositor::SuspendReason>("X11Compositor::SuspendReason");
|
||||
}
|
||||
|
||||
void X11Compositor::toggleCompositing()
|
||||
|
@ -1015,25 +1014,27 @@ void X11Compositor::updateClientCompositeBlocking(X11Client *c)
|
|||
if (c->isBlockingCompositing()) {
|
||||
// Do NOT attempt to call suspend(true) from within the eventchain!
|
||||
if (!(m_suspended & BlockRuleSuspend))
|
||||
QMetaObject::invokeMethod(this, "suspend", Qt::QueuedConnection,
|
||||
Q_ARG(SuspendReason, BlockRuleSuspend));
|
||||
QMetaObject::invokeMethod(this, [this]() {
|
||||
suspend(BlockRuleSuspend);
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
else if (m_suspended & BlockRuleSuspend) {
|
||||
// If !c we just check if we can resume in case a blocking client was lost.
|
||||
bool resume = true;
|
||||
bool shouldResume = true;
|
||||
|
||||
for (ClientList::ConstIterator it = Workspace::self()->clientList().constBegin();
|
||||
it != Workspace::self()->clientList().constEnd(); ++it) {
|
||||
if ((*it)->isBlockingCompositing()) {
|
||||
resume = false;
|
||||
shouldResume = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (resume) {
|
||||
if (shouldResume) {
|
||||
// Do NOT attempt to call suspend(false) from within the eventchain!
|
||||
QMetaObject::invokeMethod(this, "resume", Qt::QueuedConnection,
|
||||
Q_ARG(SuspendReason, BlockRuleSuspend));
|
||||
QMetaObject::invokeMethod(this, [this]() {
|
||||
resume(BlockRuleSuspend);
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,6 +201,8 @@ public:
|
|||
AllReasonSuspend = 0xff
|
||||
};
|
||||
Q_DECLARE_FLAGS(SuspendReasons, SuspendReason)
|
||||
Q_ENUM(SuspendReason)
|
||||
Q_FLAG(SuspendReasons)
|
||||
|
||||
static X11Compositor *create(QObject *parent = nullptr);
|
||||
|
||||
|
@ -214,7 +216,7 @@ public:
|
|||
* @see resume
|
||||
* @see isActive
|
||||
*/
|
||||
Q_INVOKABLE void suspend(SuspendReason reason);
|
||||
void suspend(SuspendReason reason);
|
||||
|
||||
/**
|
||||
* @brief Resumes the Compositor if it is currently suspended.
|
||||
|
@ -233,7 +235,7 @@ public:
|
|||
* @see isCompositingPossible
|
||||
* @see isOpenGLBroken
|
||||
*/
|
||||
Q_INVOKABLE void resume(SuspendReason reason);
|
||||
void resume(SuspendReason reason);
|
||||
|
||||
void toggleCompositing() override;
|
||||
void reinitialize() override;
|
||||
|
|
|
@ -830,8 +830,10 @@ bool SceneOpenGL::viewportLimitsMatched(const QSize &size) const {
|
|||
GLint limit[2];
|
||||
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit);
|
||||
if (limit[0] < size.width() || limit[1] < size.height()) {
|
||||
QMetaObject::invokeMethod(static_cast<X11Compositor*>(Compositor::self()), "suspend",
|
||||
Qt::QueuedConnection, Q_ARG(X11Compositor::SuspendReason, X11Compositor::AllReasonSuspend));
|
||||
auto compositor = static_cast<X11Compositor*>(Compositor::self());
|
||||
QMetaObject::invokeMethod(compositor, [compositor]() {
|
||||
compositor->suspend(X11Compositor::AllReasonSuspend);
|
||||
}, Qt::QueuedConnection);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue