From da81b0f86c8f9a5718ae9b2184f5d689440e81d2 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 15 May 2020 12:24:36 +0200 Subject: [PATCH] Improve opengl debug messages Summary: Don't include the \n at the end of the debug messages Test Plan: Now I can see the debug errors without an empty line below Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29684 --- plugins/scenes/opengl/scene_opengl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index 09588d9c3b..6608e25196 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -411,8 +411,9 @@ void SceneOpenGL::initDebugOutput() Q_UNUSED(source) Q_UNUSED(severity) Q_UNUSED(userParam) - while (message[length] == '\n' || message[length] == '\r') + while (length && std::isspace(message[length - 1])) { --length; + } switch (type) { case GL_DEBUG_TYPE_ERROR: