From 6ead28a6a107354fae55eb0cb68d35f8ce436f69 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Wed, 1 Sep 2021 06:12:30 +0200 Subject: [PATCH] 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. --- src/composite.cpp | 4 ++-- src/plugins/platforms/x11/standalone/x11_platform.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/composite.cpp b/src/composite.cpp index 4e6afc0593..8d8edb323b 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -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()) { diff --git a/src/plugins/platforms/x11/standalone/x11_platform.cpp b/src/plugins/platforms/x11/standalone/x11_platform.cpp index ee5243c100..474ba074ff 100644 --- a/src/plugins/platforms/x11/standalone/x11_platform.cpp +++ b/src/plugins/platforms/x11/standalone/x11_platform.cpp @@ -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; }