composite: adjust terminal messages (prio + text)

This makes the compositingPossible() output more elaborative,
and adjusts their priorities to qCWarning.

I thought about dropping the "Compositing is not possible"
(qCCritical) message. It's not critical for X11 and Wayland
depends on OpenGL. OTOH it's from a different component. So in
the end I settled for qCWarning again; there is no real way
to know, if the platform will consider this a critical problem
(and eventually abort).

Then I saw X11StandalonePlatform::compositingNotPossibleReason,
which has more user friendly, QT Richtext / HTML encoded output,
but this seems overkill for the terminal; now I would like to
know, where this is actually used...

While at it report "manually" suspended compositing via qCInfo
instead of qCDebug.
This commit is contained in:
Jan-Marek Glogowski 2021-09-01 06:12:30 +02:00 committed by Vlad Zahorodnii
parent bcdf047018
commit 6ead28a6a1
2 changed files with 7 additions and 6 deletions

View file

@ -769,10 +769,10 @@ void X11Compositor::start()
if (m_suspended & ScriptSuspend) {
reasons << QStringLiteral("Disabled by Script");
}
qCDebug(KWIN_CORE) << "Compositing is suspended, reason:" << reasons;
qCInfo(KWIN_CORE) << "Compositing is suspended, reason:" << reasons;
return;
} else if (!kwinApp()->platform()->compositingPossible()) {
qCCritical(KWIN_CORE) << "Compositing is not possible";
qCWarning(KWIN_CORE) << "Compositing is not possible";
return;
}
if (!Compositor::setupStart()) {

View file

@ -232,16 +232,17 @@ bool X11StandalonePlatform::compositingPossible() const
const QString unsafeKey(QLatin1String("OpenGLIsUnsafe") + (kwinApp()->isX11MultiHead() ? QString::number(kwinApp()->x11ScreenNumber()) : QString()));
if (gl_workaround_group.readEntry("Backend", "OpenGL") == QLatin1String("OpenGL") &&
gl_workaround_group.readEntry(unsafeKey, false)) {
qCDebug(KWIN_X11STANDALONE) << "kwinrc :: [Compositing] :: " << unsafeKey << " is true";
qCWarning(KWIN_X11STANDALONE) << "Compositing disabled: video driver seems unstable. If you think it's a false positive, please remove "
<< unsafeKey << " from [Compositing] in kwinrc and restart kwin.";
return false;
}
if (!Xcb::Extensions::self()->isCompositeAvailable()) {
qCDebug(KWIN_X11STANDALONE) << "No composite extension available";
qCWarning(KWIN_X11STANDALONE) << "Compositing disabled: no composite extension available";
return false;
}
if (!Xcb::Extensions::self()->isDamageAvailable()) {
qCDebug(KWIN_X11STANDALONE) << "No damage extension available";
qCWarning(KWIN_X11STANDALONE) << "Compositing disabled: no damage extension available";
return false;
}
if (hasGlx())
@ -251,7 +252,7 @@ bool X11StandalonePlatform::compositingPossible() const
} else if (qstrcmp(qgetenv("KWIN_COMPOSE"), "O2ES") == 0) {
return true;
}
qCDebug(KWIN_X11STANDALONE) << "No OpenGL support";
qCWarning(KWIN_X11STANDALONE) << "Compositing disabled: no OpenGL support";
return false;
}