From ac72e9fb7381e198eddac7d3dd4e1578f9852a72 Mon Sep 17 00:00:00 2001 From: Jacob Logan Date: Fri, 29 Nov 2013 16:18:28 +1100 Subject: [PATCH] Changed debug statements in kwin/effects from qDebug() to qCDebug(KWINEFFECTS) A new .cpp file is added containing the declaration of the logging category and compiled into the effects lib. REVIEW: 114194 --- effects/CMakeLists.txt | 2 +- effects/blur/blurshader.cpp | 1 - effects/coverswitch/coverswitch.cpp | 2 -- effects/cube/cube.cpp | 19 +++++++------ effects/desktopgrid/desktopgrid.cpp | 1 - effects/fallapart/fallapart.cpp | 19 +++++++------ effects/flipswitch/flipswitch.cpp | 1 - effects/highlightwindow/highlightwindow.cpp | 4 +-- effects/invert/invert.cpp | 1 - effects/kscreen/kscreen.cpp | 4 +-- effects/logging.cpp | 21 +++++++++++++++ effects/logout/logout.cpp | 5 ++-- effects/lookingglass/lookingglass.cpp | 5 ++-- effects/mousemark/mousemark.cpp | 2 -- effects/presentwindows/presentwindows.cpp | 7 +++-- effects/screenshot/screenshot.cpp | 5 ++-- effects/slidingpopups/slidingpopups.cpp | 1 - effects/startupfeedback/startupfeedback.cpp | 5 ++-- effects/taskbarthumbnail/taskbarthumbnail.cpp | 2 -- effects/trackmouse/trackmouse.cpp | 2 -- effects/wobblywindows/wobblywindows.cpp | 27 +++++++++---------- effects/zoom/zoom.cpp | 3 +-- libkwineffects/kwineffects.h | 7 +++++ main.cpp | 3 ++- 24 files changed, 76 insertions(+), 73 deletions(-) create mode 100644 effects/logging.cpp diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index 886a0fdcb7..40440c7471 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -97,7 +97,7 @@ endmacro() install( FILES kwineffect.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) # Create initial variables -set( kwin4_effect_builtins_sources ) +set( kwin4_effect_builtins_sources logging.cpp) if( NOT KWIN_MOBILE_EFFECTS ) set( kwin4_effect_builtins_config_sources configs_builtins.cpp ) endif() diff --git a/effects/blur/blurshader.cpp b/effects/blur/blurshader.cpp index 0cd14e1440..2172a05717 100644 --- a/effects/blur/blurshader.cpp +++ b/effects/blur/blurshader.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index f2ff5b01b0..0e2d581b7b 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -34,8 +34,6 @@ along with this program. If not, see . #include -#include - namespace KWin { diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index a6c61ef44d..a8ff239cc8 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -31,7 +31,6 @@ along with this program. If not, see . #include #include -#include #include #include #include @@ -1328,7 +1327,7 @@ void CubeEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPa if (activated && cube_painting) { region= infiniteRegion(); // we need to explicitly prevent any clipping, bug #325432 shader = shaderManager->pushShader(ShaderManager::GenericShader); - //qDebug() << w->caption(); + //qCDebug(KWINEFFECTS) << w->caption(); float opacity = cubeOpacity; if (start) { opacity = 1.0 - (1.0 - opacity) * timeLine.currentValue(); @@ -1625,13 +1624,13 @@ bool CubeEffect::borderActivated(ElectricBorder border) void CubeEffect::toggleCube() { - qDebug() << "toggle cube"; + qCDebug(KWINEFFECTS) << "toggle cube"; toggle(Cube); } void CubeEffect::toggleCylinder() { - qDebug() << "toggle cylinder"; + qCDebug(KWINEFFECTS) << "toggle cylinder"; if (!useShaders) useShaders = loadShader(); if (useShaders) @@ -1642,7 +1641,7 @@ void CubeEffect::toggleCylinder() void CubeEffect::toggleSphere() { - qDebug() << "toggle sphere"; + qCDebug(KWINEFFECTS) << "toggle sphere"; if (!useShaders) useShaders = loadShader(); if (useShaders) @@ -1704,7 +1703,7 @@ void CubeEffect::grabbedKeyboardEvent(QKeyEvent* e) // wrap only on autorepeat case Qt::Key_Left: // rotate to previous desktop - qDebug() << "left"; + qCDebug(KWINEFFECTS) << "left"; if (!rotating && !start) { rotating = true; if (invertKeys) @@ -1722,7 +1721,7 @@ void CubeEffect::grabbedKeyboardEvent(QKeyEvent* e) break; case Qt::Key_Right: // rotate to next desktop - qDebug() << "right"; + qCDebug(KWINEFFECTS) << "right"; if (!rotating && !start) { rotating = true; if (invertKeys) @@ -1739,7 +1738,7 @@ void CubeEffect::grabbedKeyboardEvent(QKeyEvent* e) } break; case Qt::Key_Up: - qDebug() << "up"; + qCDebug(KWINEFFECTS) << "up"; if (invertKeys) { if (verticalPosition != Down) { if (!verticalRotating) { @@ -1781,7 +1780,7 @@ void CubeEffect::grabbedKeyboardEvent(QKeyEvent* e) } break; case Qt::Key_Down: - qDebug() << "down"; + qCDebug(KWINEFFECTS) << "down"; if (invertKeys) { if (verticalPosition != Up) { if (!verticalRotating) { @@ -1920,7 +1919,7 @@ void CubeEffect::setActive(bool active) zOrderingFactor = zPosition / (effects->stackingOrder().count() - 1); start = true; effects->setActiveFullScreenEffect(this); - qDebug() << "Cube is activated"; + qCDebug(KWINEFFECTS) << "Cube is activated"; verticalPosition = Normal; verticalRotating = false; manualAngle = 0.0; diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 7364fb4728..5d54496eb2 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -31,7 +31,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 73483cb8cd..ace7868c54 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -19,7 +19,6 @@ along with this program. If not, see . *********************************************************************/ #include "fallapart.h" -#include #include #include #include @@ -135,15 +134,15 @@ bool FallApartEffect::isRealWindow(EffectWindow* w) { // TODO: isSpecialWindow is rather generic, maybe tell windowtypes separately? /* - qDebug() << "--" << w->caption() << "--------------------------------"; - qDebug() << "Tooltip:" << w->isTooltip(); - qDebug() << "Toolbar:" << w->isToolbar(); - qDebug() << "Desktop:" << w->isDesktop(); - qDebug() << "Special:" << w->isSpecialWindow(); - qDebug() << "TopMenu:" << w->isTopMenu(); - qDebug() << "Notific:" << w->isNotification(); - qDebug() << "Splash:" << w->isSplash(); - qDebug() << "Normal:" << w->isNormalWindow(); + qCDebug(KWINEFFECTS) << "--" << w->caption() << "--------------------------------"; + qCDebug(KWINEFFECTS) << "Tooltip:" << w->isTooltip(); + qCDebug(KWINEFFECTS) << "Toolbar:" << w->isToolbar(); + qCDebug(KWINEFFECTS) << "Desktop:" << w->isDesktop(); + qCDebug(KWINEFFECTS) << "Special:" << w->isSpecialWindow(); + qCDebug(KWINEFFECTS) << "TopMenu:" << w->isTopMenu(); + qCDebug(KWINEFFECTS) << "Notific:" << w->isNotification(); + qCDebug(KWINEFFECTS) << "Splash:" << w->isSplash(); + qCDebug(KWINEFFECTS) << "Normal:" << w->isNormalWindow(); */ if (!w->isNormalWindow()) return false; diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index 92040bc201..337e6e0fd9 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -27,7 +27,6 @@ along with this program. If not, see . #include #include -#include #include #include #include diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp index e29a739943..647b47bcfd 100644 --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -20,8 +20,6 @@ along with this program. If not, see . #include "highlightwindow.h" -#include - namespace KWin { @@ -163,7 +161,7 @@ void HighlightWindowEffect::slotPropertyNotify(EffectWindow* w, long a, EffectWi m_highlightedIds << data[i]; EffectWindow* foundWin = effects->findWindow(data[i]); if (!foundWin) { - qDebug() << "Invalid window targetted for highlight. Requested:" << data[i]; + qCDebug(KWINEFFECTS) << "Invalid window targetted for highlight. Requested:" << data[i]; continue; // might come in later. } m_highlightedWindows.append(foundWin); diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index acc974a41e..85b918c54f 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -27,7 +27,6 @@ along with this program. If not, see . #include #include #include -#include #include #include diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp index ccc9ee72d3..574742535a 100644 --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -21,8 +21,6 @@ along with this program. If not, see . #include "kscreen.h" // KConfigSkeleton #include "kscreenconfig.h" -// Qt -#include /** * How this effect works: @@ -165,7 +163,7 @@ void KscreenEffect::propertyNotify(EffectWindow *window, long int atom) effects->addRepaintFull(); return; } - qDebug() << "Incorrect Property state, immediate stop: " << data[0]; + qCDebug(KWINEFFECTS) << "Incorrect Property state, immediate stop: " << data[0]; m_state = StateNormal; effects->addRepaintFull(); } diff --git a/effects/logging.cpp b/effects/logging.cpp new file mode 100644 index 0000000000..f65c5ec7f0 --- /dev/null +++ b/effects/logging.cpp @@ -0,0 +1,21 @@ +/******************************************************************** + KWin - the KDE window manager + This file is part of the KDE project. + +Copyright (C) 2013 Martin Gräßlin + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*********************************************************************/ +#include +Q_LOGGING_CATEGORY(KWINEFFECTS, "kwineffects"); diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 2c6bf27b23..5e19469697 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -28,7 +28,6 @@ along with this program. If not, see . #include "kwinglplatform.h" #include -#include #include #include @@ -307,7 +306,7 @@ void LogoutEffect::renderVignetting() QStandardPaths::locate(QStandardPaths::GenericDataLocation, m_shadersDir + QStringLiteral("vignetting.frag"))); if (!m_vignettingShader->isValid()) { - qDebug() << "Vignetting Shader failed to load"; + qCDebug(KWINEFFECTS) << "Vignetting Shader failed to load"; return; } } else if (!m_vignettingShader->isValid()) { @@ -388,7 +387,7 @@ void LogoutEffect::renderBlurTexture() QStandardPaths::locate(QStandardPaths::GenericDataLocation, m_shadersDir + QStringLiteral("logout-blur.frag"))); if (!m_blurShader->isValid()) { - qDebug() << "Logout blur shader failed to load"; + qCDebug(KWINEFFECTS) << "Logout blur shader failed to load"; } } else if (!m_blurShader->isValid()) { // shader is broken - no need to continue here diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index 4a20a2ce47..28a578d848 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -31,7 +31,6 @@ along with this program. If not, see . #include #include #include -#include #include #include @@ -94,7 +93,7 @@ void LookingGlassEffect::reconfigure(ReconfigureFlags) LookingGlassConfig::self()->readConfig(); initialradius = LookingGlassConfig::radius(); radius = initialradius; - qDebug() << QStringLiteral("Radius from config: %1").arg(radius) << endl; + qCDebug(KWINEFFECTS) << QStringLiteral("Radius from config: %1").arg(radius) << endl; actionCollection->readSettings(); m_valid = loadData(); } @@ -215,7 +214,7 @@ void LookingGlassEffect::prePaintScreen(ScreenPrePaintData& data, int time) zoom = qMin(zoom * qMax(1.0 + diff, 1.2), target_zoom); else zoom = qMax(zoom * qMin(1.0 - diff, 0.8), target_zoom); - qDebug() << "zoom is now " << zoom; + qCDebug(KWINEFFECTS) << "zoom is now " << zoom; radius = qBound((double)initialradius, initialradius * zoom, 3.5 * initialradius); if (zoom <= 1.0f) { diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index 628d1b2f63..1276a43a6e 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -33,8 +33,6 @@ along with this program. If not, see . #include -#include - #ifdef KWIN_HAVE_XRENDER_COMPOSITING #include #endif diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 82af622df8..03e50b1e7b 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -26,7 +26,6 @@ along with this program. If not, see . #include #include #include -#include #include #include @@ -866,7 +865,7 @@ void PresentWindowsEffect::slotPropertyNotify(EffectWindow* w, long a) for (int i = 0; i < length; i++) { EffectWindow* foundWin = effects->findWindow(data[i]); if (!foundWin) { - qDebug() << "Invalid window targetted for present windows. Requested:" << data[i]; + qCDebug(KWINEFFECTS) << "Invalid window targetted for present windows. Requested:" << data[i]; continue; } m_selectedWindows.append(foundWin); @@ -1114,7 +1113,7 @@ void PresentWindowsEffect::calculateWindowTransformationsKompose(EffectWindowLis rows = (int)ceil(sqrt((double)windowlist.count())); columns = (int)ceil((double)windowlist.count() / (double)rows); } - //qDebug() << "Using " << rows << " rows & " << columns << " columns for " << windowlist.count() << " clients"; + //qCDebug(KWINEFFECTS) << "Using " << rows << " rows & " << columns << " columns for " << windowlist.count() << " clients"; // Calculate width & height int w = (availRect.width() - (columns + 1) * spacing) / columns; @@ -1217,7 +1216,7 @@ void PresentWindowsEffect::calculateWindowTransformationsKompose(EffectWindowLis // winData->slot = pos; motionManager.moveWindow(window, target); - //qDebug() << "Window '" << window->caption() << "' gets moved to (" << + //qCDebug(KWINEFFECTS) << "Window '" << window->caption() << "' gets moved to (" << // mWindowData[window].area.left() << "; " << mWindowData[window].area.right() << // "), scale: " << mWindowData[window].scale << endl; } diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 597b7b7ec7..be3c9f0abf 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -21,7 +21,6 @@ along with this program. If not, see . #include "screenshot.h" #include #include -#include #include #include #include @@ -275,14 +274,14 @@ QString ScreenShotEffect::blitScreenshot(const QRect &geometry) { #ifdef KWIN_HAVE_OPENGLES Q_UNUSED(geometry) - qDebug() << "Framebuffer Blit not supported"; + qCDebug(KWINEFFECTS) << "Framebuffer Blit not supported"; return QString(); #else QImage img; if (effects->isOpenGLCompositing()) { if (!GLRenderTarget::blitSupported()) { - qDebug() << "Framebuffer Blit not supported"; + qCDebug(KWINEFFECTS) << "Framebuffer Blit not supported"; return QString(); } GLTexture tex(geometry.width(), geometry.height()); diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 1f31a8517b..823023e9d0 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -20,7 +20,6 @@ along with this program. If not, see . #include "slidingpopups.h" -#include #include #include diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index 5499ed23c1..d700138931 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -19,7 +19,6 @@ along with this program. If not, see . *********************************************************************/ #include "startupfeedback.h" // Qt -#include #include #include #include @@ -134,9 +133,9 @@ void StartupFeedbackEffect::reconfigure(Effect::ReconfigureFlags flags) const QString shader = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/blinking-startup-fragment.glsl")); m_blinkingShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::SimpleShader, shader); if (m_blinkingShader->isValid()) { - qDebug() << "Blinking Shader is valid"; + qCDebug(KWINEFFECTS) << "Blinking Shader is valid"; } else { - qDebug() << "Blinking Shader is not valid"; + qCDebug(KWINEFFECTS) << "Blinking Shader is not valid"; } } } else diff --git a/effects/taskbarthumbnail/taskbarthumbnail.cpp b/effects/taskbarthumbnail/taskbarthumbnail.cpp index 31fcd5dd52..0321d6a19d 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.cpp +++ b/effects/taskbarthumbnail/taskbarthumbnail.cpp @@ -21,8 +21,6 @@ along with this program. If not, see . #include "taskbarthumbnail.h" -#include - #include // This effect shows a preview inside a window that has a special property set diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp index a19972ae78..294a402e20 100644 --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -38,8 +38,6 @@ along with this program. If not, see . #include -#include - namespace KWin { diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp index 8878693b65..271f7ba7e9 100644 --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -12,7 +12,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "wobblywindows.h" #include "wobblywindowsconfig.h" -#include #include #define USE_ASSERT @@ -164,7 +163,7 @@ WobblyWindowsEffect::~WobblyWindowsEffect() if (!windows.empty()) { // we should be empty at this point... // emit a warning and clean the list. - qDebug() << "Windows list not empty. Left items : " << windows.count(); + qCDebug(KWINEFFECTS) << "Windows list not empty. Left items : " << windows.count(); QHash< const EffectWindow*, WindowWobblyInfos >::iterator i; for (i = windows.begin(); i != windows.end(); ++i) { freeWobblyInfo(i.value()); @@ -180,7 +179,7 @@ void WobblyWindowsEffect::reconfigure(ReconfigureFlags) if (settingsMode != QStringLiteral("Custom")) { unsigned int wobblynessLevel = WobblyWindowsConfig::wobblynessLevel(); if (wobblynessLevel > 4) { - qDebug() << "Wrong value for \"WobblynessLevel\" : " << wobblynessLevel; + qCDebug(KWINEFFECTS) << "Wrong value for \"WobblynessLevel\" : " << wobblynessLevel; wobblynessLevel = 4; } setParameterSet(pset[wobblynessLevel]); @@ -215,7 +214,7 @@ void WobblyWindowsEffect::reconfigure(ReconfigureFlags) m_resizeWobble = WobblyWindowsConfig::resizeWobble(); #if defined VERBOSE_MODE - qDebug() << "Parameters :\n" << + qCDebug(KWINEFFECTS) << "Parameters :\n" << "move : " << m_moveEffectEnabled << ", open : " << m_openEffectEnabled << ", close : " << m_closeEffectEnabled << "\n" "grid(" << m_stiffness << ", " << m_drag << ", " << m_move_factor << ")\n" << "velocity(" << m_minVelocity << ", " << m_maxVelocity << ", " << m_stopVelocity << ")\n" << @@ -292,7 +291,7 @@ void WobblyWindowsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da while (!stop && (updateTime > maxTime)) { #if defined VERBOSE_MODE - qDebug() << "loop time " << updateTime << " / " << time; + qCDebug(KWINEFFECTS) << "loop time " << updateTime << " / " << time; #endif stop = !updateWindowWobblyDatas(w, maxTime); updateTime -= maxTime; @@ -422,14 +421,14 @@ void WobblyWindowsEffect::startMovedResized(EffectWindow* w) int indy = (picked.y - rect.y()) / y_increment + 0.5; int pickedPointIndex = indy * wwi.width + indx; if (pickedPointIndex < 0) { - qDebug() << "Picked index == " << pickedPointIndex << " with (" << cursorPos().x() << "," << cursorPos().y() << ")"; + qCDebug(KWINEFFECTS) << "Picked index == " << pickedPointIndex << " with (" << cursorPos().x() << "," << cursorPos().y() << ")"; pickedPointIndex = 0; } else if (static_cast(pickedPointIndex) > wwi.count - 1) { - qDebug() << "Picked index == " << pickedPointIndex << " with (" << cursorPos().x() << "," << cursorPos().y() << ")"; + qCDebug(KWINEFFECTS) << "Picked index == " << pickedPointIndex << " with (" << cursorPos().x() << "," << cursorPos().y() << ")"; pickedPointIndex = wwi.count - 1; } #if defined VERBOSE_MODE - qDebug() << "Original Picked point -- x : " << picked.x << " - y : " << picked.y; + qCDebug(KWINEFFECTS) << "Original Picked point -- x : " << picked.x << " - y : " << picked.y; #endif wwi.constraint[pickedPointIndex] = true; @@ -716,8 +715,8 @@ bool WobblyWindowsEffect::updateWindowWobblyDatas(EffectWindow* w, qreal time) qreal y_length = rect.height() / (wwi.height - 1.0); #if defined VERBOSE_MODE - qDebug() << "time " << time; - qDebug() << "increment x " << x_length << " // y" << y_length; + qCDebug(KWINEFFECTS) << "time " << time; + qCDebug(KWINEFFECTS) << "increment x " << x_length << " // y" << y_length; #endif Pair origine = {rect.x(), rect.y()}; @@ -1013,7 +1012,7 @@ bool WobblyWindowsEffect::updateWindowWobblyDatas(EffectWindow* w, qreal time) #if defined VERBOSE_MODE if (wwi.constraint[i]) { - qDebug() << "Constraint point ** vel : " << vel.x << "," << vel.y << " ** move : " << vel.x*time << "," << vel.y*time; + qCDebug(KWINEFFECTS) << "Constraint point ** vel : " << vel.x << "," << vel.y << " ** move : " << vel.x*time << "," << vel.y*time; } #endif } @@ -1041,10 +1040,10 @@ bool WobblyWindowsEffect::updateWindowWobblyDatas(EffectWindow* w, qreal time) #if defined VERBOSE_MODE # if defined COMPUTE_STATS - qDebug() << "Acceleration bounds (" << accBound.x << ", " << accBound.y << ")"; - qDebug() << "Velocity bounds (" << velBound.x << ", " << velBound.y << ")"; + qCDebug(KWINEFFECTS) << "Acceleration bounds (" << accBound.x << ", " << accBound.y << ")"; + qCDebug(KWINEFFECTS) << "Velocity bounds (" << velBound.x << ", " << velBound.y << ")"; # endif - qDebug() << "sum_acc : " << acc_sum << " *** sum_vel :" << vel_sum; + qCDebug(KWINEFFECTS) << "sum_acc : " << acc_sum << " *** sum_vel :" << vel_sum; #endif if (wwi.status != Moving && acc_sum < m_stopAcceleration && vel_sum < m_stopVelocity) { diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index ffe516f2f5..c5932fe5eb 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -25,7 +25,6 @@ along with this program. If not, see . #include #include -#include #include #include #include @@ -205,7 +204,7 @@ void ZoomEffect::recreateTexture() XcursorImageDestroy(ximg); } else { - qDebug() << "Loading cursor image (" << theme << ") FAILED -> falling back to proportional mouse tracking!"; + qCDebug(KWINEFFECTS) << "Loading cursor image (" << theme << ") FAILED -> falling back to proportional mouse tracking!"; mouseTracking = MouseTrackingProportional; } } diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index d771c0d24b..2ba8306def 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -34,6 +34,7 @@ along with this program. If not, see . #include #include +#include #include #include #include @@ -52,6 +53,12 @@ class QGraphicsScale; class QKeyEvent; class QMatrix4x4; +/** + * Logging category to be used inside the KWin effects. + * Do not use in this library. + **/ +Q_DECLARE_LOGGING_CATEGORY(KWINEFFECTS); + namespace KWin { diff --git a/main.cpp b/main.cpp index d50530fa8c..621a5490be 100644 --- a/main.cpp +++ b/main.cpp @@ -394,7 +394,8 @@ KDE_EXPORT int kdemain(int argc, char * argv[]) mallopt(M_TRIM_THRESHOLD, 5*pagesize); #endif // M_TRIM_THRESHOLD - QLoggingCategory::setFilterRules(QStringLiteral("aurorae.debug = true")); + QLoggingCategory::setFilterRules(QStringLiteral("aurorae.debug = true\n") + + QStringLiteral("kwineffects.debug = true")); int primaryScreen = 0; xcb_connection_t *c = xcb_connect(nullptr, &primaryScreen);