From kde-commits Fri Dec 05 13:29:14 2014 From: =?utf-8?q?Martin_Gr=C3=A4=C3=9Flin?= Date: Fri, 05 Dec 2014 13:29:14 +0000 To: kde-commits Subject: [kwin] /: Introduce categorized logging for kwin core Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=141778616912887 Git commit 0d997b10936563eb770b22e1c96ecace5a899512 by Martin Gr=C3=A4=C3= =9Flin, on behalf of Daniel Pastushchak. Committed on 05/12/2014 at 10:42. Pushed by graesslin into branch 'master'. Introduce categorized logging for kwin core Done by Daniel Pastushchak for KDE during GCI-2014. M +11 -11 activation.cpp M +4 -4 activities.cpp M +2 -0 autotests/test_builtin_effectloader.cpp M +2 -0 autotests/test_client_machine.cpp M +2 -0 autotests/test_plugin_effectloader.cpp M +2 -0 autotests/test_scripted_effectloader.cpp M +2 -0 autotests/test_xrandr_screens.cpp M +5 -5 client.cpp M +2 -1 client_machine.cpp M +16 -16 composite.cpp M +4 -3 compositingprefs.cpp M +1 -1 deleted.cpp M +20 -19 effectloader.cpp M +2 -2 effects.cpp M +15 -15 egl_wayland_backend.cpp M +15 -15 eglonxbackend.cpp M +1 -1 events.cpp M +14 -14 geometry.cpp M +8 -8 glxbackend.cpp M +13 -13 group.cpp M +3 -3 input.cpp M +2 -2 lanczosfilter.cpp M +9 -9 layers.cpp M +9 -8 logind.cpp M +5 -4 main.cpp M +1 -1 netinfo.cpp M +15 -14 options.cpp M +2 -2 outline.cpp M +1 -1 rules.cpp M +3 -3 scene.cpp M +28 -28 scene_opengl.cpp M +4 -4 scene_qpainter.cpp M +5 -3 scene_xrender.cpp M +8 -7 screens_wayland.cpp M +1 -1 sm.cpp M +2 -2 tabgroup.cpp M +1 -1 tests/CMakeLists.txt M +3 -0 tests/libinputtest.cpp M +1 -1 thumbnailitem.cpp M +1 -1 toplevel.cpp M +6 -6 useractions.cpp M +2 -1 utils.cpp M +2 -1 utils.h M +2 -1 wayland_backend.cpp M +1 -1 workspace.cpp M +7 -6 xcbutils.cpp http://commits.kde.org/kwin/0d997b10936563eb770b22e1c96ecace5a899512 diff --git a/activation.cpp b/activation.cpp index 9662f32..b089f46 100644 --- a/activation.cpp +++ b/activation.cpp @@ -380,7 +380,7 @@ void Workspace::takeActivity(Client* c, ActivityFlags f= lags) if (c->tabGroup() && c->tabGroup()->current() !=3D c) c->tabGroup()->setCurrent(c); if (!c->isShown(true)) { // shouldn't happen, call activateClient() i= f needed - qWarning() << "takeActivity: not shown" ; + qCWarning(KWIN_CORE) << "takeActivity: not shown" ; return; } = @@ -565,18 +565,18 @@ bool Workspace::allowClientActivation(const KWin::Cli= ent *c, xcb_timestamp_t tim if (!ignore_desktop && !c->isOnCurrentDesktop()) return false; // allow only with level =3D=3D 0 if (ac =3D=3D NULL || ac->isDesktop()) { - qDebug() << "Activation: No client active, allowing"; + qCDebug(KWIN_CORE) << "Activation: No client active, allowing"; return true; // no active client -> always allow } // TODO window urgency -> return true? if (Client::belongToSameApplication(c, ac, true)) { - qDebug() << "Activation: Belongs to active application"; + qCDebug(KWIN_CORE) << "Activation: Belongs to active application"; return true; } if (level =3D=3D 3) // high return false; if (time =3D=3D -1U) { // no time known - qDebug() << "Activation: No timestamp at all"; + qCDebug(KWIN_CORE) << "Activation: No timestamp at all"; if (level =3D=3D 1) // low return true; // no timestamp at all, don't activate - because there's also crea= tion timestamp @@ -586,7 +586,7 @@ bool Workspace::allowClientActivation(const KWin::Clien= t *c, xcb_timestamp_t tim } // level =3D=3D 2 // normal Time user_time =3D ac->userTime(); - qDebug() << "Activation, compared:" << c << ":" << time << ":" << user= _time + qCDebug(KWIN_CORE) << "Activation, compared:" << c << ":" << time << "= :" << user_time << ":" << (NET::timestampCompare(time, user_time) >=3D 0)= << endl; return NET::timestampCompare(time, user_time) >=3D 0; // time >=3D u= ser_time } @@ -607,18 +607,18 @@ bool Workspace::allowFullClientRaising(const KWin::Cl= ient *c, xcb_timestamp_t ti if (level =3D=3D 4) // extreme return false; if (ac =3D=3D NULL || ac->isDesktop()) { - qDebug() << "Raising: No client active, allowing"; + qCDebug(KWIN_CORE) << "Raising: No client active, allowing"; return true; // no active client -> always allow } // TODO window urgency -> return true? if (Client::belongToSameApplication(c, ac, true)) { - qDebug() << "Raising: Belongs to active application"; + qCDebug(KWIN_CORE) << "Raising: Belongs to active application"; return true; } if (level =3D=3D 3) // high return false; xcb_timestamp_t user_time =3D ac->userTime(); - qDebug() << "Raising, compared:" << time << ":" << user_time + qCDebug(KWIN_CORE) << "Raising, compared:" << time << ":" << user_time << ":" << (NET::timestampCompare(time, user_time) >=3D 0)= << endl; return NET::timestampCompare(time, user_time) >=3D 0; // time >=3D u= ser_time } @@ -707,7 +707,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const = KStartupInfoId *asn_id, c time =3D asn_id->timestamp(); } } - qDebug() << "User timestamp, ASN:" << time; + qCDebug(KWIN_CORE) << "User timestamp, ASN:" << time; if (time =3D=3D -1U) { // The window doesn't have any timestamp. // If it's the first window for its application @@ -740,7 +740,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const = KStartupInfoId *asn_id, c } // don't refuse if focus stealing prevention is turned off if (!first_window && rules()->checkFSP(options->focusStealingP= reventionLevel()) > 0) { - qDebug() << "User timestamp, already exists:" << 0; + qCDebug(KWIN_CORE) << "User timestamp, already exists:" <<= 0; return 0; // refuse activation } } @@ -757,7 +757,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const = KStartupInfoId *asn_id, c return -1U; time =3D readUserCreationTime(); } - qDebug() << "User timestamp, final:" << this << ":" << time; + qCDebug(KWIN_CORE) << "User timestamp, final:" << this << ":" << time; return time; } = diff --git a/activities.cpp b/activities.cpp index 725b311..4891680 100644 --- a/activities.cpp +++ b/activities.cpp @@ -125,7 +125,7 @@ bool Activities::start(const QString &id) if (ksmserver.isValid()) { ksmserver.asyncCall("restoreSubSession", id); } else { - qDebug() << "couldn't get ksmserver interface"; + qCDebug(KWIN_CORE) << "couldn't get ksmserver interface"; return false; } return true; @@ -150,7 +150,7 @@ void Activities::reallyStop(const QString &id) if (ws->sessionSaving()) return; //ksmserver doesn't queue requests (yet) = - qDebug() << id; + qCDebug(KWIN_CORE) << id; = QSet saveSessionIds; QSet dontCloseSessionIds; @@ -194,14 +194,14 @@ void Activities::reallyStop(const QString &id) } } = - qDebug() << "saveActivity" << id << saveAndClose << saveOnly; + qCDebug(KWIN_CORE) << "saveActivity" << id << saveAndClose << saveOnly; = //pass off to ksmserver QDBusInterface ksmserver("org.kde.ksmserver", "/KSMServer", "org.kde.K= SMServerInterface"); if (ksmserver.isValid()) { ksmserver.asyncCall("saveSubSession", id, saveAndClose, saveOnly); } else { - qDebug() << "couldn't get ksmserver interface"; + qCDebug(KWIN_CORE) << "couldn't get ksmserver interface"; } } = diff --git a/autotests/test_builtin_effectloader.cpp b/autotests/test_built= in_effectloader.cpp index 6c7e6f6..3c268c6 100644 --- a/autotests/test_builtin_effectloader.cpp +++ b/autotests/test_builtin_effectloader.cpp @@ -33,6 +33,8 @@ Q_DECLARE_METATYPE(KWin::LoadEffectFlags) Q_DECLARE_METATYPE(KWin::BuiltInEffect) Q_DECLARE_METATYPE(KWin::Effect*) = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + namespace KWin { = diff --git a/autotests/test_client_machine.cpp b/autotests/test_client_mach= ine.cpp index dd48453..6bafd5c 100644 --- a/autotests/test_client_machine.cpp +++ b/autotests/test_client_machine.cpp @@ -32,6 +32,8 @@ along with this program. If not, see . #include #include = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + using namespace KWin; = class TestClientMachine : public QObject diff --git a/autotests/test_plugin_effectloader.cpp b/autotests/test_plugin= _effectloader.cpp index 4340e36..c34a97a 100644 --- a/autotests/test_plugin_effectloader.cpp +++ b/autotests/test_plugin_effectloader.cpp @@ -32,6 +32,8 @@ Q_DECLARE_METATYPE(KWin::LoadEffectFlag) Q_DECLARE_METATYPE(KWin::LoadEffectFlags) Q_DECLARE_METATYPE(KWin::Effect*) = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + namespace KWin { = diff --git a/autotests/test_scripted_effectloader.cpp b/autotests/test_scri= pted_effectloader.cpp index f592107..50064e8 100644 --- a/autotests/test_scripted_effectloader.cpp +++ b/autotests/test_scripted_effectloader.cpp @@ -34,6 +34,8 @@ Q_DECLARE_METATYPE(KWin::LoadEffectFlag) Q_DECLARE_METATYPE(KWin::LoadEffectFlags) Q_DECLARE_METATYPE(KWin::Effect*) = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + namespace KWin { ScreenEdges *ScreenEdges::s_self =3D nullptr; diff --git a/autotests/test_xrandr_screens.cpp b/autotests/test_xrandr_scre= ens.cpp index 470a427..8f896aa 100644 --- a/autotests/test_xrandr_screens.cpp +++ b/autotests/test_xrandr_screens.cpp @@ -24,6 +24,8 @@ along with this program. If not, see . // Qt #include = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + // mocking namespace KWin { diff --git a/client.cpp b/client.cpp index a9826c7..45a31fc 100644 --- a/client.cpp +++ b/client.cpp @@ -1278,7 +1278,7 @@ void Client::closeWindow() */ void Client::killWindow() { - qDebug() << "Client::killWindow():" << caption(); + qCDebug(KWIN_CORE) << "Client::killWindow():" << caption(); killProcess(false); m_client.kill(); // Always kill this client at the server destroyClient(); @@ -1299,7 +1299,7 @@ void Client::pingWindow() ping_timer =3D new QTimer(this); connect(ping_timer, &QTimer::timeout, this, [this]() { - qDebug() << "Ping timeout:" << caption(); + qCDebug(KWIN_CORE) << "Ping timeout:" << caption(); ping_timer->deleteLater(); ping_timer =3D nullptr; killProcess(true, m_pingTimestamp); @@ -1332,7 +1332,7 @@ void Client::killProcess(bool ask, xcb_timestamp_t ti= mestamp) pid_t pid =3D info->pid(); if (pid <=3D 0 || clientMachine()->hostName().isEmpty()) // Needed pr= operties missing return; - qDebug() << "Kill process:" << pid << "(" << clientMachine()->hostName= () << ")"; + qCDebug(KWIN_CORE) << "Kill process:" << pid << "(" << clientMachine()= ->hostName() << ")"; if (!ask) { if (!clientMachine()->isLocal()) { QStringList lst; @@ -2249,13 +2249,13 @@ void Client::checkActivities() //otherwise, somebody else changed it. we need to validate before reac= ting QStringList allActivities =3D Activities::self()->all(); if (allActivities.isEmpty()) { - qDebug() << "no activities!?!?"; + qCDebug(KWIN_CORE) << "no activities!?!?"; //don't touch anything, there's probably something bad going on an= d we don't wanna make it worse return; } for (int i =3D 0; i < newActivitiesList.size(); ++i) { if (! allActivities.contains(newActivitiesList.at(i))) { - qDebug() << "invalid:" << newActivitiesList.at(i); + qCDebug(KWIN_CORE) << "invalid:" << newActivitiesList.at(i); newActivitiesList.removeAt(i--); } } diff --git a/client_machine.cpp b/client_machine.cpp index dd9cbc1..77e4e84 100644 --- a/client_machine.cpp +++ b/client_machine.cpp @@ -19,6 +19,7 @@ along with this program. If not, see . *********************************************************************/ // own #include "client_machine.h" +#include "utils.h" // KF5 #include // Qt @@ -120,7 +121,7 @@ bool GetAddrInfo::resolved(QFutureWatcher< int >* watch= er) return false; } if (watcher->result() !=3D 0) { - qDebug() << "getaddrinfo failed with error:" << gai_strerror(watch= er->result()); + qCDebug(KWIN_CORE) << "getaddrinfo failed with error:" << gai_stre= rror(watcher->result()); // call failed; deleteLater(); return false; diff --git a/composite.cpp b/composite.cpp index 43e5ead..c4145a3 100644 --- a/composite.cpp +++ b/composite.cpp @@ -156,10 +156,10 @@ void Compositor::setup() if (m_suspended & ScriptSuspend) { reasons << QStringLiteral("Disabled by Script"); } - qDebug() << "Compositing is suspended, reason:" << reasons; + qCDebug(KWIN_CORE) << "Compositing is suspended, reason:" << reaso= ns; return; } else if (!CompositingPrefs::compositingPossible()) { - qCritical() << "Compositing is not possible"; + qCCritical(KWIN_CORE) << "Compositing is not possible"; return; } m_starting =3D true; @@ -195,14 +195,14 @@ void Compositor::slotCompositingOptionsInitialized() = switch(options->compositingMode()) { case OpenGLCompositing: { - qDebug() << "Initializing OpenGL compositing"; + qCDebug(KWIN_CORE) << "Initializing OpenGL compositing"; = // Some broken drivers crash on glXQuery() so to prevent constant = KWin crashes: KSharedConfigPtr unsafeConfigPtr =3D KSharedConfig::openConfig(); KConfigGroup unsafeConfig(unsafeConfigPtr, "Compositing"); const QString openGLIsUnsafe =3D QStringLiteral("OpenGLIsUnsafe") = + (is_multihead ? QString::number(screen_number) : QString()); if (unsafeConfig.readEntry(openGLIsUnsafe, false)) - qWarning() << "KWin has detected that your OpenGL library is u= nsafe to use"; + qCWarning(KWIN_CORE) << "KWin has detected that your OpenGL li= brary is unsafe to use"; else { unsafeConfig.writeEntry(openGLIsUnsafe, true); unsafeConfig.sync(); @@ -210,7 +210,7 @@ void Compositor::slotCompositingOptionsInitialized() if (!CompositingPrefs::hasGlx()) { unsafeConfig.writeEntry(openGLIsUnsafe, false); unsafeConfig.sync(); - qDebug() << "No glx extensions available"; + qCDebug(KWIN_CORE) << "No glx extensions available"; break; } #endif @@ -234,36 +234,36 @@ void Compositor::slotCompositingOptionsInitialized() } #ifdef KWIN_HAVE_XRENDER_COMPOSITING case XRenderCompositing: - qDebug() << "Initializing XRender compositing"; + qCDebug(KWIN_CORE) << "Initializing XRender compositing"; m_scene =3D SceneXrender::createScene(); break; #endif case QPainterCompositing: - qDebug() << "Initializing QPainter compositing"; + qCDebug(KWIN_CORE) << "Initializing QPainter compositing"; m_scene =3D SceneQPainter::createScene(); break; default: - qDebug() << "No compositing enabled"; + qCDebug(KWIN_CORE) << "No compositing enabled"; m_starting =3D false; cm_selection->owning =3D false; cm_selection->release(); if (kwinApp()->requiresCompositing()) { - qCritical() << "The used windowing system requires compositing= "; - qCritical() << "We are going to quit KWin now as it is broken"; + qCCritical(KWIN_CORE) << "The used windowing system requires c= ompositing"; + qCCritical(KWIN_CORE) << "We are going to quit KWin now as it = is broken"; qApp->quit(); } return; } if (m_scene =3D=3D NULL || m_scene->initFailed()) { - qCritical() << "Failed to initialize compositing, compositing disa= bled"; + qCCritical(KWIN_CORE) << "Failed to initialize compositing, compos= iting disabled"; delete m_scene; m_scene =3D NULL; m_starting =3D false; cm_selection->owning =3D false; cm_selection->release(); if (kwinApp()->requiresCompositing()) { - qCritical() << "The used windowing system requires compositing= "; - qCritical() << "We are going to quit KWin now as it is broken"; + qCCritical(KWIN_CORE) << "The used windowing system requires c= ompositing"; + qCCritical(KWIN_CORE) << "We are going to quit KWin now as it = is broken"; qApp->quit(); } return; @@ -371,7 +371,7 @@ void Compositor::releaseCompositorSelection() m_releaseSelectionTimer.start(); return; } - qDebug() << "Releasing compositor selection"; + qCDebug(KWIN_CORE) << "Releasing compositor selection"; cm_selection->owning =3D false; cm_selection->release(); } @@ -1105,10 +1105,10 @@ bool Toplevel::updateUnredirectedState() lastUnredirect.start(); unredirect =3D should; if (unredirect) { - qDebug() << "Unredirecting:" << this; + qCDebug(KWIN_CORE) << "Unredirecting:" << this; xcb_composite_unredirect_window(connection(), frameId(), XCB_COMPO= SITE_REDIRECT_MANUAL); } else { - qDebug() << "Redirecting:" << this; + qCDebug(KWIN_CORE) << "Redirecting:" << this; xcb_composite_redirect_window(connection(), frameId(), XCB_COMPOSI= TE_REDIRECT_MANUAL); discardWindowPixmap(); } diff --git a/compositingprefs.cpp b/compositingprefs.cpp index ee92851..103123f 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #include "main.h" #include "xcbutils.h" #include "kwinglplatform.h" +#include "utils.h" = #include #include @@ -68,11 +69,11 @@ bool CompositingPrefs::compositingPossible() } = if (!Xcb::Extensions::self()->isCompositeAvailable()) { - qDebug() << "No composite extension available"; + qCDebug(KWIN_CORE) << "No composite extension available"; return false; } if (!Xcb::Extensions::self()->isDamageAvailable()) { - qDebug() << "No damage extension available"; + qCDebug(KWIN_CORE) << "No damage extension available"; return false; } if (hasGlx()) @@ -84,7 +85,7 @@ bool CompositingPrefs::compositingPossible() #ifdef KWIN_HAVE_OPENGLES return true; #endif - qDebug() << "No OpenGL or XRender/XFixes support"; + qCDebug(KWIN_CORE) << "No OpenGL or XRender/XFixes support"; return false; } = diff --git a/deleted.cpp b/deleted.cpp index b3bd9aa..3c4dad9 100644 --- a/deleted.cpp +++ b/deleted.cpp @@ -48,7 +48,7 @@ Deleted::Deleted() Deleted::~Deleted() { if (delete_refcount !=3D 0) - qCritical() << "Deleted client has non-zero reference count (" << = delete_refcount << ")"; + qCCritical(KWIN_CORE) << "Deleted client has non-zero reference co= unt (" << delete_refcount << ")"; assert(delete_refcount =3D=3D 0); workspace()->removeDeleted(this); deleteEffectWindow(); diff --git a/effectloader.cpp b/effectloader.cpp index 2e58c5f..73a7c9a 100644 --- a/effectloader.cpp +++ b/effectloader.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include #include "effects/effect_builtins.h" #include "scripting/scriptedeffect.h" +#include "utils.h" // KDE #include #include @@ -129,7 +130,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &nam= e, BuiltInEffect effect, return false; } if (!flags.testFlag(LoadEffectFlag::Load)) { - qDebug() << "Loading flags disable effect: " << name; + qCDebug(KWIN_CORE) << "Loading flags disable effect: " << name; return false; } // check that it is not already loaded @@ -142,13 +143,13 @@ bool BuiltInEffectLoader::loadEffect(const QString &n= ame, BuiltInEffect effect, effects->makeOpenGLContextCurrent(); #endif if (!BuiltInEffects::supported(effect)) { - qDebug() << "Effect is not supported: " << name; + qCDebug(KWIN_CORE) << "Effect is not supported: " << name; return false; } = if (flags.testFlag(LoadEffectFlag::CheckDefaultFunction)) { if (!BuiltInEffects::checkEnabledByDefault(effect)) { - qDebug() << "Enabled by default function disables effect: " <<= name; + qCDebug(KWIN_CORE) << "Enabled by default function disables ef= fect: " << name; return false; } } @@ -156,7 +157,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &nam= e, BuiltInEffect effect, // ok, now we can try to create the Effect Effect *e =3D BuiltInEffects::create(effect); if (!e) { - qDebug() << "Failed to create effect: " << name; + qCDebug(KWIN_CORE) << "Failed to create effect: " << name; return false; } // insert in our loaded effects @@ -166,7 +167,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &nam= e, BuiltInEffect effect, m_loadedEffects.remove(effect); } ); - qDebug() << "Successfully loaded built-in effect: " << name; + qCDebug(KWIN_CORE) << "Successfully loaded built-in effect: " << name; emit effectLoaded(e, name); return true; } @@ -224,17 +225,17 @@ bool ScriptedEffectLoader::loadEffect(KService::Ptr e= ffect, LoadEffectFlags flag { const QString name =3D effect->property(s_nameProperty).toString(); if (!flags.testFlag(LoadEffectFlag::Load)) { - qDebug() << "Loading flags disable effect: " << name; + qCDebug(KWIN_CORE) << "Loading flags disable effect: " << name; return false; } if (m_loadedEffects.contains(name)) { - qDebug() << name << "already loaded"; + qCDebug(KWIN_CORE) << name << "already loaded"; return false; } = ScriptedEffect *e =3D ScriptedEffect::create(effect); if (!e) { - qDebug() << "Could not initialize scripted effect: " << name; + qCDebug(KWIN_CORE) << "Could not initialize scripted effect: " << = name; return false; } connect(e, &ScriptedEffect::destroyed, this, @@ -243,7 +244,7 @@ bool ScriptedEffectLoader::loadEffect(KService::Ptr eff= ect, LoadEffectFlags flag } ); = - qDebug() << "Successfully loaded scripted effect: " << name; + qCDebug(KWIN_CORE) << "Successfully loaded scripted effect: " << name; emit effectLoaded(e, name); m_loadedEffects << name; return true; @@ -328,12 +329,12 @@ EffectPluginFactory *PluginEffectLoader::factory(cons= t KPluginInfo &info) const } KPluginLoader loader(info.libraryPath()); if (loader.pluginVersion() !=3D KWIN_EFFECT_API_VERSION) { - qDebug() << info.pluginName() << " has not matching plugin version= , expected " << KWIN_EFFECT_API_VERSION << "got " << loader.pluginVersion(); + qCDebug(KWIN_CORE) << info.pluginName() << " has not matching plug= in version, expected " << KWIN_EFFECT_API_VERSION << "got " << loader.plugi= nVersion(); return nullptr; } KPluginFactory *factory =3D loader.factory(); if (!factory) { - qDebug() << "Did not get KPluginFactory for " << info.pluginName(); + qCDebug(KWIN_CORE) << "Did not get KPluginFactory for " << info.pl= uginName(); return nullptr; } return dynamic_cast< EffectPluginFactory* >(factory); @@ -361,21 +362,21 @@ bool PluginEffectLoader::loadEffect(const QString &na= me) bool PluginEffectLoader::loadEffect(const KPluginInfo &info, LoadEffectFla= gs flags) { if (!info.isValid()) { - qDebug() << "Plugin info is not valid"; + qCDebug(KWIN_CORE) << "Plugin info is not valid"; return false; } const QString name =3D info.pluginName(); if (!flags.testFlag(LoadEffectFlag::Load)) { - qDebug() << "Loading flags disable effect: " << name; + qCDebug(KWIN_CORE) << "Loading flags disable effect: " << name; return false; } if (m_loadedEffects.contains(name)) { - qDebug() << name << " already loaded"; + qCDebug(KWIN_CORE) << name << " already loaded"; return false; } EffectPluginFactory *effectFactory =3D factory(info); if (!effectFactory) { - qDebug() << "Couldn't get an EffectPluginFactory for: " << name; + qCDebug(KWIN_CORE) << "Couldn't get an EffectPluginFactory for: " = << name; return false; } = @@ -383,13 +384,13 @@ bool PluginEffectLoader::loadEffect(const KPluginInfo= &info, LoadEffectFlags fla effects->makeOpenGLContextCurrent(); #endif if (!effectFactory->isSupported()) { - qDebug() << "Effect is not supported: " << name; + qCDebug(KWIN_CORE) << "Effect is not supported: " << name; return false; } = if (flags.testFlag(LoadEffectFlag::CheckDefaultFunction)) { if (!effectFactory->enabledByDefault()) { - qDebug() << "Enabled by default function disables effect: " <<= name; + qCDebug(KWIN_CORE) << "Enabled by default function disables ef= fect: " << name; return false; } } @@ -397,7 +398,7 @@ bool PluginEffectLoader::loadEffect(const KPluginInfo &= info, LoadEffectFlags fla // ok, now we can try to create the Effect Effect *e =3D effectFactory->createEffect(); if (!e) { - qDebug() << "Failed to create effect: " << name; + qCDebug(KWIN_CORE) << "Failed to create effect: " << name; return false; } // insert in our loaded effects @@ -407,7 +408,7 @@ bool PluginEffectLoader::loadEffect(const KPluginInfo &= info, LoadEffectFlags fla m_loadedEffects.removeAll(name); } ); - qDebug() << "Successfully loaded plugin effect: " << name; + qCDebug(KWIN_CORE) << "Successfully loaded plugin effect: " << name; emit effectLoaded(e, name); return true; } diff --git a/effects.cpp b/effects.cpp index 48011ee..28319fd 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1307,7 +1307,7 @@ void EffectsHandlerImpl::unloadEffect(const QString& = name) = for (QMap< int, EffectPair >::iterator it =3D effect_order.begin(); it= !=3D effect_order.end(); ++it) { if (it.value().first =3D=3D name) { - qDebug() << "EffectsHandler::unloadEffect : Unloading Effect := " << name; + qCDebug(KWIN_CORE) << "EffectsHandler::unloadEffect : Unloadin= g Effect : " << name; if (activeFullScreenEffect() =3D=3D it.value().second) { setActiveFullScreenEffect(0); } @@ -1324,7 +1324,7 @@ void EffectsHandlerImpl::unloadEffect(const QString& = name) } } = - qDebug() << "EffectsHandler::unloadEffect : Effect not loaded : " << n= ame; + qCDebug(KWIN_CORE) << "EffectsHandler::unloadEffect : Effect not loade= d : " << name; } = void EffectsHandlerImpl::reconfigureEffect(const QString& name) diff --git a/egl_wayland_backend.cpp b/egl_wayland_backend.cpp index 9dc4e82..21a6449 100644 --- a/egl_wayland_backend.cpp +++ b/egl_wayland_backend.cpp @@ -46,7 +46,7 @@ EglWaylandBackend::EglWaylandBackend() setFailed("Wayland Backend has not been created"); return; } - qDebug() << "Connected to Wayland display?" << (m_wayland->display() ?= "yes" : "no" ); + qCDebug(KWIN_CORE) << "Connected to Wayland display?" << (m_wayland->d= isplay() ? "yes" : "no" ); if (!m_wayland->display()) { setFailed("Could not connect to Wayland compositor"); return; @@ -57,9 +57,9 @@ EglWaylandBackend::EglWaylandBackend() // Egl is always direct rendering setIsDirectRendering(true); = - qWarning() << "Using Wayland rendering backend"; - qWarning() << "This is a highly experimental backend, do not use for p= roductive usage!"; - qWarning() << "Please do not report any issues you might encounter whe= n using this backend!"; + qCWarning(KWIN_CORE) << "Using Wayland rendering backend"; + qCWarning(KWIN_CORE) << "This is a highly experimental backend, do not= use for productive usage!"; + qCWarning(KWIN_CORE) << "Please do not report any issues you might enc= ounter when using this backend!"; } = EglWaylandBackend::~EglWaylandBackend() @@ -108,20 +108,20 @@ bool EglWaylandBackend::initializeEgl() return false; EGLint error =3D eglGetError(); if (error !=3D EGL_SUCCESS) { - qWarning() << "Error during eglInitialize " << error; + qCWarning(KWIN_CORE) << "Error during eglInitialize " << error; return false; } - qDebug() << "Egl Initialize succeeded"; + qCDebug(KWIN_CORE) << "Egl Initialize succeeded"; = #ifdef KWIN_HAVE_OPENGLES eglBindAPI(EGL_OPENGL_ES_API); #else if (eglBindAPI(EGL_OPENGL_API) =3D=3D EGL_FALSE) { - qCritical() << "bind OpenGL API failed"; + qCCritical(KWIN_CORE) << "bind OpenGL API failed"; return false; } #endif - qDebug() << "EGL version: " << major << "." << minor; + qCDebug(KWIN_CORE) << "EGL version: " << major << "." << minor; return true; } = @@ -183,7 +183,7 @@ bool EglWaylandBackend::initRenderingContext() #endif = if (m_context =3D=3D EGL_NO_CONTEXT) { - qCritical() << "Create Context failed"; + qCCritical(KWIN_CORE) << "Create Context failed"; return false; } = @@ -196,7 +196,7 @@ bool EglWaylandBackend::initRenderingContext() connect(s, &KWayland::Client::Surface::frameRendered, Compositor::self= (), &Compositor::bufferSwapComplete); m_overlay =3D wl_egl_window_create(*s, size.width(), size.height()); if (!m_overlay) { - qCritical() << "Creating Wayland Egl window failed"; + qCCritical(KWIN_CORE) << "Creating Wayland Egl window failed"; return false; } = @@ -206,7 +206,7 @@ bool EglWaylandBackend::initRenderingContext() m_surface =3D eglCreateWindowSurface(m_display, m_config, m_overla= y, nullptr); = if (m_surface =3D=3D EGL_NO_SURFACE) { - qCritical() << "Create Window Surface failed"; + qCCritical(KWIN_CORE) << "Create Window Surface failed"; return false; } = @@ -216,13 +216,13 @@ bool EglWaylandBackend::initRenderingContext() bool EglWaylandBackend::makeContextCurrent() { if (eglMakeCurrent(m_display, m_surface, m_surface, m_context) =3D=3D = EGL_FALSE) { - qCritical() << "Make Context Current failed"; + qCCritical(KWIN_CORE) << "Make Context Current failed"; return false; } = EGLint error =3D eglGetError(); if (error !=3D EGL_SUCCESS) { - qWarning() << "Error occurred while creating context " << error; + qCWarning(KWIN_CORE) << "Error occurred while creating context " <= < error; return false; } return true; @@ -248,11 +248,11 @@ bool EglWaylandBackend::initBufferConfigs() EGLint count; EGLConfig configs[1024]; if (eglChooseConfig(m_display, config_attribs, configs, 1, &count) =3D= =3D EGL_FALSE) { - qCritical() << "choose config failed"; + qCCritical(KWIN_CORE) << "choose config failed"; return false; } if (count !=3D 1) { - qCritical() << "choose config did not return a config" << count; + qCCritical(KWIN_CORE) << "choose config did not return a config" <= < count; return false; } m_config =3D configs[0]; diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 2a3a5e6..d54635b 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -122,7 +122,7 @@ void EglOnXBackend::init() gs_tripleBufferNeedsDetection =3D false; m_swapProfiler.init(); if (surfaceHasSubPost) { - qDebug() << "EGL implementation and surface support eglPostSubBuff= erNV, let's use it"; + qCDebug(KWIN_CORE) << "EGL implementation and surface support eglP= ostSubBufferNV, let's use it"; = if (options->glPreferBufferSwap() !=3D Options::NoSwapEncourage) { // check if swap interval 1 is supported @@ -130,7 +130,7 @@ void EglOnXBackend::init() eglGetConfigAttrib(dpy, config, EGL_MAX_SWAP_INTERVAL, &val); if (val >=3D 1) { if (eglSwapInterval(dpy, 1)) { - qDebug() << "Enabled v-sync"; + qCDebug(KWIN_CORE) << "Enabled v-sync"; setSyncsToVBlank(true); const QByteArray tripleBuffer =3D qgetenv("KWIN_TRIPLE= _BUFFER"); if (!tripleBuffer.isEmpty()) { @@ -140,7 +140,7 @@ void EglOnXBackend::init() gs_tripleBufferNeedsDetection =3D gs_tripleBufferUndet= ected; } } else { - qWarning() << "Cannot enable v-sync as max. swap interval = is" << val; + qCWarning(KWIN_CORE) << "Cannot enable v-sync as max. swap= interval is" << val; } } else { // disable v-sync @@ -152,7 +152,7 @@ void EglOnXBackend::init() * Hence we need EGL to preserve the backbuffer for us, so that we= can draw the partial updates on it and call * eglSwapBuffers() for each frame. eglSwapBuffers() then does the= copy (no page flip possible in this mode), * which means it is slow and not synced to the v-blank. */ - qWarning() << "eglPostSubBufferNV not supported, have to enable bu= ffer preservation - which breaks v-sync and performance"; + qCWarning(KWIN_CORE) << "eglPostSubBufferNV not supported, have to= enable buffer preservation - which breaks v-sync and performance"; eglSurfaceAttrib(dpy, surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESE= RVED); } } @@ -198,7 +198,7 @@ bool EglOnXBackend::initRenderingContext() eglBindAPI(EGL_OPENGL_ES_API); #else if (eglBindAPI(EGL_OPENGL_API) =3D=3D EGL_FALSE) { - qCritical() << "bind OpenGL API failed"; + qCCritical(KWIN_CORE) << "bind OpenGL API failed"; return false; } #endif @@ -206,7 +206,7 @@ bool EglOnXBackend::initRenderingContext() initBufferConfigs(); = if (!overlayWindow()->create()) { - qCritical() << "Could not get overlay window"; + qCCritical(KWIN_CORE) << "Could not get overlay window"; return false; } else { overlayWindow()->setup(None); @@ -253,20 +253,20 @@ bool EglOnXBackend::initRenderingContext() #endif = if (ctx =3D=3D EGL_NO_CONTEXT) { - qCritical() << "Create Context failed"; + qCCritical(KWIN_CORE) << "Create Context failed"; return false; } = if (eglMakeCurrent(dpy, surface, surface, ctx) =3D=3D EGL_FALSE) { - qCritical() << "Make Context Current failed"; + qCCritical(KWIN_CORE) << "Make Context Current failed"; return false; } = - qDebug() << "EGL version: " << major << "." << minor; + qCDebug(KWIN_CORE) << "EGL version: " << major << "." << minor; = EGLint error =3D eglGetError(); if (error !=3D EGL_SUCCESS) { - qWarning() << "Error occurred while creating context " << error; + qCWarning(KWIN_CORE) << "Error occurred while creating context " <= < error; return false; } = @@ -293,13 +293,13 @@ bool EglOnXBackend::initBufferConfigs() EGLint count; EGLConfig configs[1024]; if (eglChooseConfig(dpy, config_attribs, configs, 1024, &count) =3D=3D= EGL_FALSE) { - qCritical() << "choose config failed"; + qCCritical(KWIN_CORE) << "choose config failed"; return false; } = Xcb::WindowAttributes attribs(rootWindow()); if (!attribs) { - qCritical() << "Failed to get window attributes of root window"; + qCCritical(KWIN_CORE) << "Failed to get window attributes of root = window"; return false; } = @@ -307,7 +307,7 @@ bool EglOnXBackend::initBufferConfigs() for (int i =3D 0; i < count; i++) { EGLint val; if (eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &val= ) =3D=3D EGL_FALSE) { - qCritical() << "egl get config attrib failed"; + qCCritical(KWIN_CORE) << "egl get config attrib failed"; } if (uint32_t(val) =3D=3D attribs->visual) { config =3D configs[i]; @@ -341,7 +341,7 @@ void EglOnXBackend::present() if (qstrcmp(qgetenv("__GL_YIELD"), "USLEEP")) { options->setGlPreferBufferSwap(0); eglSwapInterval(dpy, 0); - qWarning() << "\nIt seems you are using the nvidia= driver without triple buffering\n" + qCWarning(KWIN_CORE) << "\nIt seems you are using = the nvidia driver without triple buffering\n" "You must export __GL_YIELD=3D\"= USLEEP\" to prevent large CPU overhead on synced swaps\n" "Preferably, enable the TripleBu= ffer Option in the xorg.conf Device\n" "For this reason, the tearing pr= evention has been disabled.\n" @@ -515,7 +515,7 @@ bool EglTexture::loadTexture(xcb_pixmap_t pix, const QS= ize &size, xcb_visualid_t (EGLClientBuffer)pix, attribs); = if (EGL_NO_IMAGE_KHR =3D=3D m_image) { - qDebug() << "failed to create egl image"; + qCDebug(KWIN_CORE) << "failed to create egl image"; q->unbind(); q->discard(); return false; diff --git a/events.cpp b/events.cpp index 48ab1c9..d6f7103 100644 --- a/events.cpp +++ b/events.cpp @@ -218,7 +218,7 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) if (errorName.isEmpty()) { errorName =3D QByteArrayLiteral("Unknown"); } - qWarning("XCB error: %d (%s), sequence: %d, resource id: %= d, major code: %d (%s), minor code: %d (%s)", + qCWarning(KWIN_CORE, "XCB error: %d (%s), sequence: %d, re= source id: %d, major code: %d (%s), minor code: %d (%s)", int(error->error_code), errorName.constData(), int(error->sequence), int(error->resource_id), int(error->major_code), extension.name.constData(= ), diff --git a/geometry.cpp b/geometry.cpp index 1f9f4d4..dd0852e 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -114,7 +114,7 @@ void Workspace::updateClientArea(bool force) const Screens *s =3D Screens::self(); int nscreens =3D s->count(); const int numberOfDesktops =3D VirtualDesktopManager::self()->count(); - qDebug() << "screens: " << nscreens << "desktops: " << numberOfDesktop= s; + qCDebug(KWIN_CORE) << "screens: " << nscreens << "desktops: " << numbe= rOfDesktops; QVector< QRect > new_wareas(numberOfDesktops + 1); QVector< StrutRects > new_rmoveareas(numberOfDesktops + 1); QVector< QVector< QRect > > new_sareas(numberOfDesktops + 1); @@ -187,7 +187,7 @@ void Workspace::updateClientArea(bool force) for (int iS =3D 0; iS < nscreens; iS ++) - qDebug() << "new_sarea: " << new_sareas[ i ][ iS ]; + qCDebug(KWIN_CORE) << "new_sarea: " << new_sareas[ i ][ iS ]; } #endif = @@ -238,7 +238,7 @@ void Workspace::updateClientArea(bool force) oldrestrictedmovearea.clear(); // reset, no longer valid or needed } = - qDebug() << "Done."; + qCDebug(KWIN_CORE) << "Done."; } = void Workspace::updateClientArea() @@ -1260,7 +1260,7 @@ QSize Client::sizeForClientSize(const QSize& wsize, S= izemode mode, bool noframe) int w =3D wsize.width(); int h =3D wsize.height(); if (w < 1 || h < 1) { - qWarning() << "sizeForClientSize() with empty size!" ; + qCWarning(KWIN_CORE) << "sizeForClientSize() with empty size!" ; } if (w < 1) w =3D 1; if (h < 1) h =3D 1; @@ -1606,7 +1606,7 @@ void Client::configureRequest(int value_mask, int rx,= int ry, int rw, int rh, in { // "maximized" is a user setting -> we do not allow the client to resi= ze itself // away from this & against the users explicit wish - qDebug() << this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)) << + qCDebug(KWIN_CORE) << this << bool(value_mask & (CWX|CWWidth|CWY|CWHei= ght)) << bool(maximizeMode() & MaximizeVertical) << bool(maximizeMode() & MaximizeHorizontal); = @@ -1638,11 +1638,11 @@ void Client::configureRequest(int value_mask, int r= x, int ry, int rw, int rh, in } = if (ignore) { - qDebug() << "DENIED"; + qCDebug(KWIN_CORE) << "DENIED"; return; // nothing to (left) to do for use - bugs #158974, #252314= , #321491 } = - qDebug() << "PERMITTED" << this << bool(value_mask & (CWX|CWWidth|CWY|= CWHeight)); + qCDebug(KWIN_CORE) << "PERMITTED" << this << bool(value_mask & (CWX|CW= Width|CWY|CWHeight)); = if (gravity =3D=3D 0) // default (nonsense) value for the argument gravity =3D xSizeHint.win_gravity; @@ -1735,7 +1735,7 @@ void Client::resizeWithChecks(int w, int h, ForceGeom= etry_t force) assert(!shade_geometry_change); if (isShade()) { if (h =3D=3D borderTop() + borderBottom()) { - qWarning() << "Shaded geometry passed for size:" ; + qCWarning(KWIN_CORE) << "Shaded geometry passed for size:" ; } } int newx =3D x(); @@ -1887,7 +1887,7 @@ void Client::setGeometry(int x, int y, int w, int h, = ForceGeometry_t force) ; // nothing else if (isShade()) { if (h =3D=3D borderTop() + borderBottom()) { - qDebug() << "Shaded geometry passed for size:"; + qCDebug(KWIN_CORE) << "Shaded geometry passed for size:"; } else { client_size =3D QSize(w - borderLeft() - borderRight(), h - bo= rderTop() - borderBottom()); h =3D borderTop() + borderBottom(); @@ -1897,7 +1897,7 @@ void Client::setGeometry(int x, int y, int w, int h, = ForceGeometry_t force) } QRect g(x, y, w, h); if (block_geometry_updates =3D=3D 0 && g !=3D rules()->checkGeometry(g= )) { - qDebug() << "forced geometry fail:" << g << ":" << rules()->checkG= eometry(g); + qCDebug(KWIN_CORE) << "forced geometry fail:" << g << ":" << rules= ()->checkGeometry(g); } if (force =3D=3D NormalGeometrySet && geom =3D=3D g && pending_geometr= y_update =3D=3D PendingGeometryNone) return; @@ -1975,7 +1975,7 @@ void Client::plainResize(int w, int h, ForceGeometry_= t force) ; // nothing else if (isShade()) { if (h =3D=3D borderTop() + borderBottom()) { - qDebug() << "Shaded geometry passed for size:"; + qCDebug(KWIN_CORE) << "Shaded geometry passed for size:"; } else { client_size =3D QSize(w - borderLeft() - borderRight(), h - bo= rderTop() - borderBottom()); h =3D borderTop() + borderBottom(); @@ -1985,7 +1985,7 @@ void Client::plainResize(int w, int h, ForceGeometry_= t force) } QSize s(w, h); if (block_geometry_updates =3D=3D 0 && s !=3D rules()->checkSize(s)) { - qDebug() << "forced size fail:" << s << ":" << rules()->checkSize(= s); + qCDebug(KWIN_CORE) << "forced size fail:" << s << ":" << rules()->= checkSize(s); } // resuming geometry updates is handled only in setGeometry() assert(pending_geometry_update =3D=3D PendingGeometryNone || block_geo= metry_updates > 0); @@ -2039,7 +2039,7 @@ void Client::move(int x, int y, ForceGeometry_t force) assert(pending_geometry_update =3D=3D PendingGeometryNone || block_geo= metry_updates > 0); QPoint p(x, y); if (block_geometry_updates =3D=3D 0 && p !=3D rules()->checkPosition(p= )) { - qDebug() << "forced position fail:" << p << ":" << rules()->checkP= osition(p); + qCDebug(KWIN_CORE) << "forced position fail:" << p << ":" << rules= ()->checkPosition(p); } if (force =3D=3D NormalGeometrySet && geom.topLeft() =3D=3D p) return; @@ -2457,7 +2457,7 @@ void Client::updateFullscreenMonitors(NETFullscreenMo= nitors topology) topology.bottom >=3D nscreens || topology.left >=3D nscreens || topology.right >=3D nscreens) { - qWarning() << "fullscreenMonitors update failed. request higher th= an number of screens."; + qCWarning(KWIN_CORE) << "fullscreenMonitors update failed. request= higher than number of screens."; return; } = diff --git a/glxbackend.cpp b/glxbackend.cpp index 4dba82a..ded74de 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -222,9 +222,9 @@ void GlxBackend::init() setBlocksForRetrace(true); haveWaitSync =3D true; } else - qWarning() << "NO VSYNC! glXSwapInterval is not supported,= glXWaitVideoSync is supported but broken"; + qCWarning(KWIN_CORE) << "NO VSYNC! glXSwapInterval is not = supported, glXWaitVideoSync is supported but broken"; } else - qWarning() << "NO VSYNC! neither glSwapInterval nor glXWaitVid= eoSync are supported"; + qCWarning(KWIN_CORE) << "NO VSYNC! neither glSwapInterval nor = glXWaitVideoSync are supported"; } else { // disable v-sync (if possible) setSwapInterval(0); @@ -320,7 +320,7 @@ bool GlxBackend::initBuffer() // Try to create double-buffered window in the overlay XVisualInfo* visual =3D glXGetVisualFromFBConfig(display(), fbconf= ig); if (!visual) { - qCritical() << "Failed to get visual from fbconfig"; + qCCritical(KWIN_CORE) << "Failed to get visual from fbconfig"; return false; } XSetWindowAttributes attrs; @@ -332,7 +332,7 @@ bool GlxBackend::initBuffer() overlayWindow()->setup(window); XFree(visual); } else { - qCritical() << "Failed to create overlay window"; + qCCritical(KWIN_CORE) << "Failed to create overlay window"; return false; } = @@ -371,7 +371,7 @@ bool GlxBackend::initFbConfig() } = if (fbconfig =3D=3D NULL) { - qCritical() << "Failed to find a usable framebuffer configuration"; + qCCritical(KWIN_CORE) << "Failed to find a usable framebuffer conf= iguration"; return false; } = @@ -416,7 +416,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t = visual) const xcb_render_directformat_t *direct =3D XRenderUtils::findPictForm= atInfo(format); = if (!direct) { - qCritical().nospace() << "Could not find a picture format for visu= al 0x" << hex << visual; + qCCritical(KWIN_CORE).nospace() << "Could not find a picture forma= t for visual 0x" << hex << visual; return info; } = @@ -449,7 +449,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t = visual) GLXFBConfig *configs =3D glXChooseFBConfig(display(), DefaultScreen(di= splay()), attribs, &count); = if (count < 1) { - qCritical().nospace() << "Could not find a framebuffer configurati= on for visual 0x" << hex << visual; + qCCritical(KWIN_CORE).nospace() << "Could not find a framebuffer c= onfiguration for visual 0x" << hex << visual; return info; } = @@ -564,7 +564,7 @@ void GlxBackend::present() if (qstrcmp(qgetenv("__GL_YIELD"), "USLEEP")) { options->setGlPreferBufferSwap(0); setSwapInterval(0); - qWarning() << "\nIt seems you are using the nv= idia driver without triple buffering\n" + qCWarning(KWIN_CORE) << "\nIt seems you are us= ing the nvidia driver without triple buffering\n" "You must export __GL_YIELD= =3D\"USLEEP\" to prevent large CPU overhead on synced swaps\n" "Preferably, enable the Trip= leBuffer Option in the xorg.conf Device\n" "For this reason, the tearin= g prevention has been disabled.\n" diff --git a/group.cpp b/group.cpp index 9f42ad8..40dc712 100644 --- a/group.cpp +++ b/group.cpp @@ -73,15 +73,15 @@ bool performTransiencyCheck() if ((*it1)->deleting) continue; if ((*it1)->in_group =3D=3D NULL) { - qDebug() << "TC: " << *it1 << " in not in a group" << endl; + qCDebug(KWIN_CORE) << "TC: " << *it1 << " in not in a group" <= < endl; ret =3D false; } else if (!(*it1)->in_group->members().contains(*it1)) { - qDebug() << "TC: " << *it1 << " has a group " << (*it1)->in_gr= oup << " but group does not contain it" << endl; + qCDebug(KWIN_CORE) << "TC: " << *it1 << " has a group " << (*i= t1)->in_group << " but group does not contain it" << endl; ret =3D false; } if (!(*it1)->isTransient()) { if (!(*it1)->mainClients().isEmpty()) { - qDebug() << "TC: " << *it1 << " is not transient, has main= clients:" << (*it1)->mainClients() << endl; + qCDebug(KWIN_CORE) << "TC: " << *it1 << " is not transient= , has main clients:" << (*it1)->mainClients() << endl; ret =3D false; } } else { @@ -92,8 +92,8 @@ bool performTransiencyCheck() if (transiencyCheckNonExistent && !Workspace::self()->clients.contains(*it2) && !Workspace::self()->desktops.contains(*it2)) { - qDebug() << "TC:" << *it1 << " has non-existent main c= lient "; - qDebug() << "TC2:" << *it2; // this may crash + qCDebug(KWIN_CORE) << "TC:" << *it1 << " has non-exist= ent main client "; + qCDebug(KWIN_CORE) << "TC2:" << *it2; // this may crash ret =3D false; continue; } @@ -110,8 +110,8 @@ bool performTransiencyCheck() if (transiencyCheckNonExistent && !Workspace::self()->clients.contains(*it2) && !Workspace::self()->desktops.contains(*it2)) { - qDebug() << "TC:" << *it1 << " has non-existent transient = "; - qDebug() << "TC2:" << *it2; // this may crash + qCDebug(KWIN_CORE) << "TC:" << *it1 << " has non-existent = transient "; + qCDebug(KWIN_CORE) << "TC2:" << *it2; // this may crash ret =3D false; continue; } @@ -130,7 +130,7 @@ bool performTransiencyCheck() it2 !=3D members.constEnd(); ++it2) { if ((*it2)->in_group !=3D *it1) { - qDebug() << "TC: Group " << *it1 << " contains client " <<= *it2 << " but client is not in that group" << endl; + qCDebug(KWIN_CORE) << "TC: Group " << *it1 << " contains c= lient " << *it2 << " but client is not in that group" << endl; ret =3D false; } } @@ -155,8 +155,8 @@ static void checkTransiency() { if (--transiencyCheck =3D=3D 0) { if (!performTransiencyCheck()) { - qDebug() << "BT:" << transiencyCheckStartBt << endl; - qDebug() << "CLIENT:" << transiencyCheckClient << endl; + qCDebug(KWIN_CORE) << "BT:" << transiencyCheckStartBt << endl; + qCDebug(KWIN_CORE) << "CLIENT:" << transiencyCheckClient << en= dl; abort(); } transiencyCheckNonExistent =3D false; @@ -736,7 +736,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t ne= w_transient_for, bool set } if (new_transient_for =3D=3D window()) { // pointing to self // also fix the property itself - qWarning() << "Client " << this << " has WM_TRANSIENT_FOR poiting = to itself." ; + qCWarning(KWIN_CORE) << "Client " << this << " has WM_TRANSIENT_FO= R poiting to itself." ; new_property_value =3D new_transient_for =3D rootWindow(); } // The transient_for window may be embedded in another application, @@ -754,7 +754,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t ne= w_transient_for, bool set } if (Client* new_transient_for_client =3D workspace()->findClient(Predi= cate::WindowMatch, new_transient_for)) { if (new_transient_for !=3D before_search) { - qDebug() << "Client " << this << " has WM_TRANSIENT_FOR poitin= g to non-toplevel window " + qCDebug(KWIN_CORE) << "Client " << this << " has WM_TRANSIENT_= FOR poiting to non-toplevel window " << before_search << ", child of " << new_transien= t_for_client << ", adjusting." << endl; new_property_value =3D new_transient_for; // also fix the prop= erty } @@ -771,7 +771,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t ne= w_transient_for, bool set break; loop_pos =3D pos->m_transientForId; if (--count =3D=3D 0 || pos =3D=3D this) { - qWarning() << "Client " << this << " caused WM_TRANSIENT_FOR l= oop." ; + qCWarning(KWIN_CORE) << "Client " << this << " caused WM_TRANS= IENT_FOR loop." ; new_transient_for =3D rootWindow(); } } diff --git a/input.cpp b/input.cpp index 84c10e9..2732a06 100644 --- a/input.cpp +++ b/input.cpp @@ -61,7 +61,7 @@ Xkb::Xkb() , m_modifiers(Qt::NoModifier) { if (!m_context) { - qDebug() << "Could not create xkb context"; + qCDebug(KWIN_CORE) << "Could not create xkb context"; } } = @@ -84,12 +84,12 @@ void Xkb::installKeymap(int fd, uint32_t size) xkb_keymap *keymap =3D xkb_keymap_new_from_string(m_context, map, XKB_= KEYMAP_FORMAT_TEXT_V1, XKB_MAP_COMPILE_PLACEHOLDER); munmap(map, size); if (!keymap) { - qDebug() << "Could not map keymap from file"; + qCDebug(KWIN_CORE) << "Could not map keymap from file"; return; } xkb_state *state =3D xkb_state_new(keymap); if (!state) { - qDebug() << "Could not create XKB state"; + qCDebug(KWIN_CORE) << "Could not create XKB state"; xkb_keymap_unref(keymap); return; } diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index 2621ecc..a1f2c09 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -64,7 +64,7 @@ void LanczosFilter::init() m_inited =3D true; const bool force =3D (qstrcmp(qgetenv("KWIN_FORCE_LANCZOS"), "1") =3D= =3D 0); if (force) { - qWarning() << "Lanczos Filter forced on by environment variable"; + qCWarning(KWIN_CORE) << "Lanczos Filter forced on by environment v= ariable"; } = if (!force && options->glSmoothScale() !=3D 2) @@ -94,7 +94,7 @@ void LanczosFilter::init() m_uKernel =3D m_shader->uniformLocation("kernel"); m_uOffsets =3D m_shader->uniformLocation("offsets"); } else { - qDebug() << "Shader is not valid"; + qCDebug(KWIN_CORE) << "Shader is not valid"; m_shader.reset(); } } diff --git a/layers.cpp b/layers.cpp index 56fb814..cf2f753 100644 --- a/layers.cpp +++ b/layers.cpp @@ -119,12 +119,12 @@ void Workspace::updateStackingOrder(bool propagate_ne= w_clients) force_restacking =3D false; stacking_order =3D new_stacking_order; #if 0 - qDebug() << "stacking:" << changed; + qCDebug(KWIN_CORE) << "stacking:" << changed; if (changed || propagate_new_clients) { for (ClientList::ConstIterator it =3D stacking_order.begin(); it !=3D stacking_order.end(); ++it) - qDebug() << (void*)(*it) << *it << ":" << (*it)->layer(); + qCDebug(KWIN_CORE) << (void*)(*it) << *it << ":" << (*it)->lay= er(); } #endif if (changed || propagate_new_clients) { @@ -491,11 +491,11 @@ ToplevelList Workspace::constrainedStackingOrder() ToplevelList layer[ NumLayers ]; = #if 0 - qDebug() << "stacking1:"; + qCDebug(KWIN_CORE) << "stacking1:"; for (ClientList::ConstIterator it =3D unconstrained_stacking_order.beg= in(); it !=3D unconstrained_stacking_order.end(); ++it) - qDebug() << (void*)(*it) << *it << ":" << (*it)->layer(); + qCDebug(KWIN_CORE) << (void*)(*it) << *it << ":" << (*it)->layer(); #endif // build the order from layers QVector< QMap > minimum_layer(screens()->count()); @@ -524,11 +524,11 @@ ToplevelList Workspace::constrainedStackingOrder() ++lay) stacking +=3D layer[ lay ]; #if 0 - qDebug() << "stacking2:"; + qCDebug(KWIN_CORE) << "stacking2:"; for (ClientList::ConstIterator it =3D stacking.begin(); it !=3D stacking.end(); ++it) - qDebug() << (void*)(*it) << *it << ":" << (*it)->layer(); + qCDebug(KWIN_CORE) << (void*)(*it) << *it << ":" << (*it)->layer(); #endif // now keep transients above their mainwindows // TODO this could(?) use some optimization @@ -590,12 +590,12 @@ ToplevelList Workspace::constrainedStackingOrder() stacking.insert(i2, current); } #if 0 - qDebug() << "stacking3:"; + qCDebug(KWIN_CORE) << "stacking3:"; for (ClientList::ConstIterator it =3D stacking.begin(); it !=3D stacking.end(); ++it) - qDebug() << (void*)(*it) << *it << ":" << (*it)->layer(); - qDebug() << "\n\n"; + qCDebug(KWIN_CORE) << (void*)(*it) << *it << ":" << (*it)->layer(); + qCDebug(KWIN_CORE) << "\n\n"; #endif return stacking; } diff --git a/logind.cpp b/logind.cpp index 2b9aaca..a04a6d7 100644 --- a/logind.cpp +++ b/logind.cpp @@ -29,6 +29,7 @@ along with this program. If not, see . = #include #include +#include "utils.h" = namespace KWin { @@ -116,11 +117,11 @@ void LogindIntegration::logindServiceRegistered() return; } if (!reply.isValid()) { - qDebug() << "The session is not registered with logind" <<= reply.error().message(); + qCDebug(KWIN_CORE) << "The session is not registered with = logind" << reply.error().message(); return; } m_sessionPath =3D reply.value().path(); - qDebug() << "Session path:" << m_sessionPath; + qCDebug(KWIN_CORE) << "Session path:" << m_sessionPath; m_connected =3D true; connectSessionPropertiesChanged(); getSessionActive(); @@ -157,7 +158,7 @@ void LogindIntegration::getSessionActive() QDBusPendingReply reply =3D *self; self->deleteLater(); if (!reply.isValid()) { - qDebug() << "Failed to get Active Property of logind sessi= on:" << reply.error().message(); + qCDebug(KWIN_CORE) << "Failed to get Active Property of lo= gind session:" << reply.error().message(); return; } const bool active =3D reply.value().toBool(); @@ -187,11 +188,11 @@ void LogindIntegration::takeControl() QDBusPendingReply reply =3D *self; self->deleteLater(); if (!reply.isValid()) { - qDebug() << "Failed to get session control" << reply.error= ().message(); + qCDebug(KWIN_CORE) << "Failed to get session control" << r= eply.error().message(); emit hasSessionControlChanged(false); return; } - qDebug() << "Gained session control"; + qCDebug(KWIN_CORE) << "Gained session control"; m_sessionControl =3D true; emit hasSessionControlChanged(true); } @@ -217,7 +218,7 @@ int LogindIntegration::takeDevice(const char *path) { struct stat st; if (stat(path, &st) < 0) { - qDebug() << "Could not stat the path"; + qCDebug(KWIN_CORE) << "Could not stat the path"; return -1; } QDBusMessage message =3D QDBusMessage::createMethodCall(s_login1Servic= e, @@ -228,7 +229,7 @@ int LogindIntegration::takeDevice(const char *path) // intended to be a blocking call QDBusMessage reply =3D m_bus.call(message); if (reply.type() =3D=3D QDBusMessage::ErrorMessage) { - qDebug() << "Could not take device" << path << ", cause: " << repl= y.errorMessage(); + qCDebug(KWIN_CORE) << "Could not take device" << path << ", cause:= " << reply.errorMessage(); return -1; } return dup(reply.arguments().first().value().= fileDescriptor()); @@ -238,7 +239,7 @@ void LogindIntegration::releaseDevice(int fd) { struct stat st; if (fstat(fd, &st) < 0) { - qDebug() << "Could not stat the file descriptor"; + qCDebug(KWIN_CORE) << "Could not stat the file descriptor"; return; } QDBusMessage message =3D QDBusMessage::createMethodCall(s_login1Servic= e, diff --git a/main.cpp b/main.cpp index 9bb6a56..18f4bc5 100644 --- a/main.cpp +++ b/main.cpp @@ -202,10 +202,10 @@ void Application::crashChecking() else ::exit(1); if (cmd.length() > 500) { - qDebug() << "Command is too long, truncating"; + qCDebug(KWIN_CORE) << "Command is too long, truncating"; cmd =3D cmd.left(500); } - qDebug() << "Starting" << cmd << "and exiting"; + qCDebug(KWIN_CORE) << "Starting" << cmd << "and exiting"; char buf[1024]; sprintf(buf, "%s &", cmd.toAscii().data()); system(buf); @@ -213,7 +213,7 @@ void Application::crashChecking() } if (crashes >=3D 2) { // Disable compositing if we have had too many crashes - qDebug() << "Too many crashes recently, disabling compositing"; + qCDebug(KWIN_CORE) << "Too many crashes recently, disabling compos= iting"; KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing"); compgroup.writeEntry("Enabled", false); } @@ -343,7 +343,8 @@ void Application::setupLocalizedString() void Application::setupLoggingCategoryFilters() { QLoggingCategory::setFilterRules(QStringLiteral("aurorae.debug =3D tru= e\n") + - QStringLiteral("kwineffects.debug =3D= true")); + QStringLiteral("kwineffects.debug =3D= true\n") + + QStringLiteral("kwin_core.debug =3D t= rue")); } = void Application::notifyKSplash() diff --git a/netinfo.cpp b/netinfo.cpp index b9044c8..e004e1d 100644 --- a/netinfo.cpp +++ b/netinfo.cpp @@ -47,7 +47,7 @@ RootInfo *RootInfo::create() ScopedCPointer error(xcb_request_check(connection= (), xcb_configure_window_checked(connection(), supportWindow, XCB_CONF= IG_WINDOW_STACK_MODE, lowerValues))); if (!error.isNull()) { - qDebug() << "Error occurred while lowering support window: " << er= ror->error_code; + qCDebug(KWIN_CORE) << "Error occurred while lowering support windo= w: " << error->error_code; } = const NET::Properties properties =3D NET::Supported | diff --git a/options.cpp b/options.cpp index c8cb62f..caba701 100644 --- a/options.cpp +++ b/options.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . = #include "options.h" #include "config-kwin.h" +#include "utils.h" = #ifndef KCMRULES = @@ -65,7 +66,7 @@ int currentRefreshRate() vtotal *=3D 2; if (modeline.htotal*vtotal) // BUG 313996 rate =3D 1000*dotclock/(modeline.htotal*vtotal); // WT= F was wikipedia 1998 when I nedded it? - qDebug() << "Vertical Refresh Rate (as detected by XF86VM)= : " << rate << "Hz"; + qCDebug(KWIN_CORE) << "Vertical Refresh Rate (as detected = by XF86VM): " << rate << "Hz"; } } if (rate < 1) @@ -85,7 +86,7 @@ int currentRefreshRate() rate =3D -1; else rate =3D qRound(frate); - qDebug() << "Vertical Refresh Rate (as detected by nvidia-= settings): " << rate << "Hz"; + qCDebug(KWIN_CORE) << "Vertical Refresh Rate (as detected = by nvidia-settings): " << rate << "Hz"; } } } @@ -102,7 +103,7 @@ int currentRefreshRate() // however, additional throttling prevents very high rates from taking= place anyway else if (rate > 1000) rate =3D 1000; - qDebug() << "Vertical Refresh rate " << rate << "Hz"; + qCDebug(KWIN_CORE) << "Vertical Refresh rate " << rate << "Hz"; return rate; } = @@ -784,24 +785,24 @@ void Options::setGlPlatformInterface(OpenGLPlatformIn= terface interface) const QByteArray envOpenGLInterface(qgetenv("KWIN_OPENGL_INTERFACE")); if (!envOpenGLInterface.isEmpty()) { if (qstrcmp(envOpenGLInterface, "egl") =3D=3D 0) { - qDebug() << "Forcing EGL native interface through environment = variable"; + qCDebug(KWIN_CORE) << "Forcing EGL native interface through en= vironment variable"; interface =3D EglPlatformInterface; } else if (qstrcmp(envOpenGLInterface, "glx") =3D=3D 0) { - qDebug() << "Forcing GLX native interface through environment = variable"; + qCDebug(KWIN_CORE) << "Forcing GLX native interface through en= vironment variable"; interface =3D GlxPlatformInterface; } } if (kwinApp()->shouldUseWaylandForCompositing() && interface =3D=3D Gl= xPlatformInterface) { // Glx is impossible on Wayland, enforce egl - qDebug() << "Forcing EGL native interface for Wayland mode"; + qCDebug(KWIN_CORE) << "Forcing EGL native interface for Wayland mo= de"; interface =3D EglPlatformInterface; } #ifdef KWIN_HAVE_OPENGLES - qDebug() << "Forcing EGL native interface as compiled against OpenGL E= S"; + qCDebug(KWIN_CORE) << "Forcing EGL native interface as compiled agains= t OpenGL ES"; interface =3D EglPlatformInterface; #else #ifndef KWIN_HAVE_EGL - qDebug() << "Forcing GLX native interface as compiled without EGL supp= ort"; + qCDebug(KWIN_CORE) << "Forcing GLX native interface as compiled withou= t EGL support"; interface =3D GlxPlatformInterface; #endif #endif @@ -934,29 +935,29 @@ bool Options::loadCompositingConfig (bool force) if (const char *c =3D getenv("KWIN_COMPOSE")) { switch(c[0]) { case 'O': - qDebug() << "Compositing forced to OpenGL mode by environment = variable"; + qCDebug(KWIN_CORE) << "Compositing forced to OpenGL mode by en= vironment variable"; compositingMode =3D OpenGLCompositing; useCompositing =3D true; break; case 'X': - qDebug() << "Compositing forced to XRender mode by environment= variable"; + qCDebug(KWIN_CORE) << "Compositing forced to XRender mode by e= nvironment variable"; compositingMode =3D XRenderCompositing; useCompositing =3D true; break; case 'Q': - qDebug() << "Compositing forced to QPainter mode by environmen= t variable"; + qCDebug(KWIN_CORE) << "Compositing forced to QPainter mode by = environment variable"; compositingMode =3D QPainterCompositing; useCompositing =3D true; break; case 'N': if (getenv("KDE_FAILSAFE")) - qDebug() << "Compositing disabled forcefully by KDE failsa= fe mode"; + qCDebug(KWIN_CORE) << "Compositing disabled forcefully by = KDE failsafe mode"; else - qDebug() << "Compositing disabled forcefully by environmen= t variable"; + qCDebug(KWIN_CORE) << "Compositing disabled forcefully by = environment variable"; compositingMode =3D NoCompositing; break; default: - qDebug() << "Unknown KWIN_COMPOSE mode set, ignoring"; + qCDebug(KWIN_CORE) << "Unknown KWIN_COMPOSE mode set, ignoring= "; break; } } diff --git a/outline.cpp b/outline.cpp index 82117ef..252e39a 100644 --- a/outline.cpp +++ b/outline.cpp @@ -153,12 +153,12 @@ void CompositedOutlineVisual::show() // TODO: fileName should be configurable const QString fileName =3D QStandardPaths::locate(QStandardPaths::= GenericDataLocation, QStringLiteral(KWIN_NAME) + QStringLiteral("/outline/p= lasma/outline.qml")); if (fileName.isEmpty()) { - qDebug() << "Could not locate outline.qml"; + qCDebug(KWIN_CORE) << "Could not locate outline.qml"; return; } m_qmlComponent->loadUrl(QUrl::fromLocalFile(fileName)); if (m_qmlComponent->isError()) { - qDebug() << "Component failed to load: " << m_qmlComponent->er= rors(); + qCDebug(KWIN_CORE) << "Component failed to load: " << m_qmlCom= ponent->errors(); } else { m_mainItem.reset(m_qmlComponent->create(m_qmlContext.data())); } diff --git a/rules.cpp b/rules.cpp index 93b9905..d07a70f 100644 --- a/rules.cpp +++ b/rules.cpp @@ -975,7 +975,7 @@ WindowRules RuleBook::find(const Client* c, bool ignore= _temporary) } if ((*it)->match(c)) { Rules* rule =3D *it; - qDebug() << "Rule found:" << rule << ":" << c; + qCDebug(KWIN_CORE) << "Rule found:" << rule << ":" << c; if (rule->isTemporary()) it =3D m_rules.erase(it); else diff --git a/scene.cpp b/scene.cpp index 915022e..94eeba1 100644 --- a/scene.cpp +++ b/scene.cpp @@ -944,20 +944,20 @@ void WindowPixmap::create() Xcb::WindowAttributes windowAttributes(toplevel()->frameId()); Xcb::WindowGeometry windowGeometry(toplevel()->frameId()); if (xcb_generic_error_t *error =3D xcb_request_check(connection(), nam= ePixmapCookie)) { - qDebug() << "Creating window pixmap failed: " << error->error_code; + qCDebug(KWIN_CORE) << "Creating window pixmap failed: " << error->= error_code; free(error); return; } // check that the received pixmap is valid and actually matches what we // know about the window (i.e. size) if (!windowAttributes || windowAttributes->map_state !=3D XCB_MAP_STAT= E_VIEWABLE) { - qDebug() << "Creating window pixmap failed: " << this; + qCDebug(KWIN_CORE) << "Creating window pixmap failed: " << this; xcb_free_pixmap(connection(), pix); return; } if (!windowGeometry || windowGeometry->width !=3D toplevel()->width() || windowGeometry->= height !=3D toplevel()->height()) { - qDebug() << "Creating window pixmap failed: " << this; + qCDebug(KWIN_CORE) << "Creating window pixmap failed: " << this; xcb_free_pixmap(connection(), pix); return; } diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ad75e87..77783f3 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -162,18 +162,18 @@ bool SyncObject::finish() glGetSynciv(m_sync, GL_SYNC_STATUS, 1, nullptr, &value); = if (value !=3D GL_SIGNALED) { - qDebug() << "Waiting for X fence to finish"; + qCDebug(KWIN_CORE) << "Waiting for X fence to finish"; = // Wait for the fence to become signaled with a one second timeout const GLenum result =3D glClientWaitSync(m_sync, 0, 1000000000); = switch (result) { case GL_TIMEOUT_EXPIRED: - qWarning() << "Timeout while waiting for X fence"; + qCWarning(KWIN_CORE) << "Timeout while waiting for X fence"; return false; = case GL_WAIT_FAILED: - qWarning() << "glClientWaitSync() failed"; + qCWarning(KWIN_CORE) << "glClientWaitSync() failed"; return false; } } @@ -304,7 +304,7 @@ OpenGLBackend::~OpenGLBackend() = void OpenGLBackend::setFailed(const QString &reason) { - qWarning() << "Creating the OpenGL rendering failed: " << reason; + qCWarning(KWIN_CORE) << "Creating the OpenGL rendering failed: " << re= ason; m_failed =3D true; } = @@ -368,13 +368,13 @@ SceneOpenGL::SceneOpenGL(Workspace* ws, OpenGLBackend= *backend) #ifndef KWIN_HAVE_OPENGLES if (!hasGLExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two= ")) && !hasGLExtension(QByteArrayLiteral("GL_ARB_texture_rectangle= "))) { - qCritical() << "GL_ARB_texture_non_power_of_two and GL_ARB_texture= _rectangle missing"; + qCCritical(KWIN_CORE) << "GL_ARB_texture_non_power_of_two and GL_A= RB_texture_rectangle missing"; init_ok =3D false; return; // error } #endif if (glPlatform->isMesaDriver() && glPlatform->mesaVersion() < kVersion= Number(8, 0)) { - qCritical() << "KWin requires at least Mesa 8.0 for OpenGL composi= ting."; + qCCritical(KWIN_CORE) << "KWin requires at least Mesa 8.0 for Open= GL compositing."; init_ok =3D false; return; } @@ -398,10 +398,10 @@ SceneOpenGL::SceneOpenGL(Workspace* ws, OpenGLBackend= *backend) const QByteArray useExplicitSync =3D qgetenv("KWIN_EXPLICIT_SYNC"); = if (useExplicitSync !=3D "0") { - qDebug() << "Initializing fences for synchronization with the = X command stream"; + qCDebug(KWIN_CORE) << "Initializing fences for synchronization= with the X command stream"; m_syncManager =3D new SyncManager; } else { - qDebug() << "Explicit synchronization with the X command strea= m disabled by environment variable"; + qCDebug(KWIN_CORE) << "Explicit synchronization with the X com= mand stream disabled by environment variable"; } } } @@ -436,7 +436,7 @@ void SceneOpenGL::initDebugOutput() switch (type) { case GL_DEBUG_TYPE_ERROR: case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: - qWarning("%#x: %.*s", id, length, message); + qCWarning(KWIN_CORE, "%#x: %.*s", id, length, message); break; = case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: @@ -444,7 +444,7 @@ void SceneOpenGL::initDebugOutput() case GL_DEBUG_TYPE_PERFORMANCE: case GL_DEBUG_TYPE_OTHER: default: - qDebug("%#x: %.*s", id, length, message); + qCDebug(KWIN_CORE, "%#x: %.*s", id, length, message); break; } }; @@ -515,9 +515,9 @@ SceneOpenGL *SceneOpenGL::createScene() } if (!scene) { if (GLPlatform::instance()->recommendedCompositor() =3D=3D XRender= Compositing) { - qCritical() << "OpenGL driver recommends XRender based composi= ting. Falling back to XRender."; - qCritical() << "To overwrite the detection use the environment= variable KWIN_COMPOSE"; - qCritical() << "For more information see http://community.kde.= org/KWin/Environment_Variables#KWIN_COMPOSE"; + qCCritical(KWIN_CORE) << "OpenGL driver recommends XRender bas= ed compositing. Falling back to XRender."; + qCCritical(KWIN_CORE) << "To overwrite the detection use the e= nvironment variable KWIN_COMPOSE"; + qCCritical(KWIN_CORE) << "For more information see http://comm= unity.kde.org/KWin/Environment_Variables#KWIN_COMPOSE"; QTimer::singleShot(0, Compositor::self(), SLOT(fallbackToXRend= erCompositing())); } delete backend; @@ -581,15 +581,15 @@ void SceneOpenGL::handleGraphicsReset(GLenum status) { switch (status) { case GL_GUILTY_CONTEXT_RESET_KWIN: - qDebug() << "A graphics reset attributable to the current GL conte= xt occurred."; + qCDebug(KWIN_CORE) << "A graphics reset attributable to the curren= t GL context occurred."; break; = case GL_INNOCENT_CONTEXT_RESET_KWIN: - qDebug() << "A graphics reset not attributable to the current GL c= ontext occurred."; + qCDebug(KWIN_CORE) << "A graphics reset not attributable to the cu= rrent GL context occurred."; break; = case GL_UNKNOWN_CONTEXT_RESET_KWIN: - qDebug() << "A graphics reset of an unknown cause occurred."; + qCDebug(KWIN_CORE) << "A graphics reset of an unknown cause occurr= ed."; break; = default: @@ -603,7 +603,7 @@ void SceneOpenGL::handleGraphicsReset(GLenum status) while (timer.elapsed() < 10000 && glGetGraphicsResetStatus() !=3D GL_N= O_ERROR) usleep(50); = - qDebug() << "Attempting to reset compositing."; + qCDebug(KWIN_CORE) << "Attempting to reset compositing."; QMetaObject::invokeMethod(this, "resetCompositing", Qt::QueuedConnecti= on); = KNotification::event(QStringLiteral("graphicsreset"), i18n("Desktop ef= fects were restarted due to a graphics reset")); @@ -672,8 +672,8 @@ qint64 SceneOpenGL::paint(QRegion damage, ToplevelList = toplevels) = if (m_currentFence) { if (!m_syncManager->updateFences()) { - qDebug() << "Aborting explicit synchronization with the X comm= and stream."; - qDebug() << "Future frames will be rendered unsynchronized."; + qCDebug(KWIN_CORE) << "Aborting explicit synchronization with = the X command stream."; + qCDebug(KWIN_CORE) << "Future frames will be rendered unsynchr= onized."; delete m_syncManager; m_syncManager =3D nullptr; } @@ -884,7 +884,7 @@ bool SceneOpenGL2::supported(OpenGLBackend *backend) const QByteArray forceEnv =3D qgetenv("KWIN_COMPOSE"); if (!forceEnv.isEmpty()) { if (qstrcmp(forceEnv, "O2") =3D=3D 0) { - qDebug() << "OpenGL 2 compositing enforced by environment vari= able"; + qCDebug(KWIN_CORE) << "OpenGL 2 compositing enforced by enviro= nment variable"; return true; } else { // OpenGL 2 disabled by environment variable @@ -895,7 +895,7 @@ bool SceneOpenGL2::supported(OpenGLBackend *backend) return false; } if (GLPlatform::instance()->recommendedCompositor() < OpenGL2Compositi= ng) { - qDebug() << "Driver does not recommend OpenGL 2 compositing"; + qCDebug(KWIN_CORE) << "Driver does not recommend OpenGL 2 composit= ing"; #ifndef KWIN_HAVE_OPENGLES return false; #endif @@ -921,7 +921,7 @@ SceneOpenGL2::SceneOpenGL2(OpenGLBackend *backend) GLRenderTarget::setVirtualScreenSize(s); GLVertexBuffer::setVirtualScreenSize(s); if (!ShaderManager::instance()->isValid()) { - qDebug() << "No Scene Shaders available"; + qCDebug(KWIN_CORE) << "No Scene Shaders available"; init_ok =3D false; return; } @@ -929,7 +929,7 @@ SceneOpenGL2::SceneOpenGL2(OpenGLBackend *backend) // push one shader on the stack so that one is always bound ShaderManager::instance()->pushShader(ShaderTrait::MapTexture); if (checkGLError("Init")) { - qCritical() << "OpenGL 2 compositing setup failed"; + qCCritical(KWIN_CORE) << "OpenGL 2 compositing setup failed"; init_ok =3D false; return; // error } @@ -943,12 +943,12 @@ SceneOpenGL2::SceneOpenGL2(OpenGLBackend *backend) #endif = if (!ShaderManager::instance()->selfTest()) { - qCritical() << "ShaderManager self test failed"; + qCCritical(KWIN_CORE) << "ShaderManager self test failed"; init_ok =3D false; return; } = - qDebug() << "OpenGL 2 compositing successfully initialized"; + qCDebug(KWIN_CORE) << "OpenGL 2 compositing successfully initialized"; init_ok =3D true; } = @@ -1087,7 +1087,7 @@ ColorCorrection *SceneOpenGL2::colorCorrection() = void SceneOpenGL2::slotColorCorrectedChanged(bool recreateShaders) { - qDebug() << "Color correction:" << options->isColorCorrected(); + qCDebug(KWIN_CORE) << "Color correction:" << options->isColorCorrected= (); if (options->isColorCorrected() && m_colorCorrection.isNull()) { m_colorCorrection.reset(new ColorCorrection(this)); if (!m_colorCorrection->setEnabled(true)) { @@ -1585,7 +1585,7 @@ bool OpenGLWindowPixmap::bind() if (success) toplevel()->resetDamage(); else - qDebug() << "Failed to bind window"; + qCDebug(KWIN_CORE) << "Failed to bind window"; return success; } = @@ -2271,7 +2271,7 @@ char SwapProfiler::end() m_time =3D (10*m_time + m_timer.nsecsElapsed())/11; if (++m_counter > 500) { const bool blocks =3D m_time > 1000 * 1000; // 1ms, i get ~250=C2= =B5s and ~7ms w/o triple buffering... - qDebug() << "Triple buffering detection:" << QString(blocks ? QStr= ingLiteral("NOT available") : QStringLiteral("Available")) << + qCDebug(KWIN_CORE) << "Triple buffering detection:" << QString(blo= cks ? QStringLiteral("NOT available") : QStringLiteral("Available")) << " - Mean block time:" << m_time/(1000.0*1000.0) <<= "ms"; return blocks ? 'd' : 't'; } diff --git a/scene_qpainter.cpp b/scene_qpainter.cpp index 550547b..56e7cbb 100644 --- a/scene_qpainter.cpp +++ b/scene_qpainter.cpp @@ -70,7 +70,7 @@ void QPainterBackend::screenGeometryChanged(const QSize &= size) = void QPainterBackend::setFailed(const QString &reason) { - qWarning() << "Creating the XRender backend failed: " << reason; + qCWarning(KWIN_CORE) << "Creating the XRender backend failed: " << rea= son; m_failed =3D true; } = @@ -150,7 +150,7 @@ void WaylandQPainterBackend::prepareRenderingFrame() const QSize size(Wayland::WaylandBackend::self()->shellSurfaceSize()); m_buffer =3D Wayland::WaylandBackend::self()->shmPool()->getBuffer(siz= e, size.width() * 4); if (!m_buffer) { - qDebug() << "Did not get a new Buffer from Shm Pool"; + qCDebug(KWIN_CORE) << "Did not get a new Buffer from Shm Pool"; m_backBuffer =3D QImage(); return; } @@ -159,7 +159,7 @@ void WaylandQPainterBackend::prepareRenderingFrame() m_backBuffer =3D QImage(b->address(), size.width(), size.height(), QIm= age::Format_RGB32); m_backBuffer.fill(Qt::transparent); m_needsFullRepaint =3D true; - qDebug() << "Created a new back buffer"; + qCDebug(KWIN_CORE) << "Created a new back buffer"; } = void WaylandQPainterBackend::remapBuffer() @@ -173,7 +173,7 @@ void WaylandQPainterBackend::remapBuffer() } const QSize size =3D m_backBuffer.size(); m_backBuffer =3D QImage(b->address(), size.width(), size.height(), QIm= age::Format_RGB32); - qDebug() << "Remapped our back buffer"; + qCDebug(KWIN_CORE) << "Remapped our back buffer"; } = bool WaylandQPainterBackend::needsFullRepaint() const diff --git a/scene_xrender.cpp b/scene_xrender.cpp index 7445b5a..30261a2 100644 --- a/scene_xrender.cpp +++ b/scene_xrender.cpp @@ -21,6 +21,8 @@ along with this program. If not, see . *********************************************************************/ #include "scene_xrender.h" = +#include "utils.h" + #ifdef KWIN_HAVE_XRENDER_COMPOSITING = #include "toplevel.h" @@ -98,7 +100,7 @@ void XRenderBackend::setBuffer(xcb_render_picture_t buff= er) = void XRenderBackend::setFailed(const QString& reason) { - qCritical() << "Creating the XRender backend failed: " << reason; + qCCritical(KWIN_CORE) << "Creating the XRender backend failed: " << re= ason; m_failed =3D true; } = @@ -270,7 +272,7 @@ void WaylandXRenderBackend::createBuffer() xcb_free_pixmap(connection(), pixmap); // The picture owns the pixma= p now setBuffer(b); = - qDebug() << "Offscreen shm pixmap created"; + qCDebug(KWIN_CORE) << "Offscreen shm pixmap created"; } = void WaylandXRenderBackend::present(int mask, const QRegion &damage) @@ -285,7 +287,7 @@ void WaylandXRenderBackend::present(int mask, const QRe= gion &damage) const QSize &size =3D wl->shellSurfaceSize(); auto buffer =3D wl->shmPool()->createBuffer(size, size.width() * 4, m_= shm->buffer()); if (!buffer) { - qDebug() << "Did not get a buffer"; + qCDebug(KWIN_CORE) << "Did not get a buffer"; return; } = diff --git a/screens_wayland.cpp b/screens_wayland.cpp index 25548d7..0503b6e 100644 --- a/screens_wayland.cpp +++ b/screens_wayland.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . = #include "wayland_backend.h" #include +#include "utils.h" #include "xcbutils.h" = #include @@ -115,7 +116,7 @@ static bool setNewScreenSize(const QSize &size) auto c =3D xcb_randr_set_screen_size_checked(connection(), rootWindow(= ), size.width(), size.height(), 1, 1); ScopedCPointer error(xcb_request_check(connection= (), c)); if (!error.isNull()) { - qDebug() << "Error setting screen size: " << error->error_code; + qCDebug(KWIN_CORE) << "Error setting screen size: " << error->erro= r_code; return false; } return true; @@ -124,7 +125,7 @@ static bool setNewScreenSize(const QSize &size) static xcb_randr_crtc_t getCrtc(const xcb_randr_get_screen_resources_curre= nt_reply_t* r) { if (xcb_randr_get_screen_resources_current_crtcs_length(r) =3D=3D 0) { - qDebug() << "No CRTCs"; + qCDebug(KWIN_CORE) << "No CRTCs"; return XCB_NONE; } return xcb_randr_get_screen_resources_current_crtcs(r)[0]; @@ -143,7 +144,7 @@ static xcb_randr_output_t getOutputForCrtc(xcb_randr_cr= tc_t crtc) static xcb_randr_mode_t createNewMode(const QSize &size) { // need to create the new mode - qDebug() << "Creating a new mode"; + qCDebug(KWIN_CORE) << "Creating a new mode"; QString name(QString::number(size.width())); name.append('x'); name.append(QString::number(size.height())); @@ -177,7 +178,7 @@ static xcb_randr_mode_t getModeForSize(const QSize &siz= e, const xcb_randr_get_sc for (int i =3D 0; i < modeInfoLength; ++i) { xcb_randr_mode_info_t modeInfo =3D infos[i]; if (modeInfo.width =3D=3D size.width() && modeInfo.height =3D=3D s= ize.height()) { - qDebug() << "Found our required mode"; + qCDebug(KWIN_CORE) << "Found our required mode"; return modeInfo.id; } } @@ -195,11 +196,11 @@ static bool addModeToOutput(xcb_randr_output_t output= , xcb_randr_mode_t mode) return true; } } - qDebug() << "Need to add the mode to output"; + qCDebug(KWIN_CORE) << "Need to add the mode to output"; auto c =3D xcb_randr_add_output_mode_checked(connection(), output, mod= e); ScopedCPointer error(xcb_request_check(connection= (), c)); if (!error.isNull()) { - qDebug() << "Error while adding mode to output: " << error->error_= code; + qCDebug(KWIN_CORE) << "Error while adding mode to output: " << err= or->error_code; return false; } return true; @@ -208,7 +209,7 @@ static bool addModeToOutput(xcb_randr_output_t output, = xcb_randr_mode_t mode) void WaylandScreens::updateXRandr() { if (!Xcb::Extensions::self()->isRandrAvailable()) { - qDebug() << "No RandR extension available, cannot sync with X"; + qCDebug(KWIN_CORE) << "No RandR extension available, cannot sync w= ith X"; return; } QRegion screens; diff --git a/sm.cpp b/sm.cpp index 5c73d47..0e3e735 100644 --- a/sm.cpp +++ b/sm.cpp @@ -178,7 +178,7 @@ void Workspace::storeSubSession(const QString &name, QS= et sessionIds if (!sessionIds.contains(sessionId)) continue; = - qDebug() << "storing" << sessionId; + qCDebug(KWIN_CORE) << "storing" << sessionId; count++; if (c->isActive()) active_client =3D count; diff --git a/tabgroup.cpp b/tabgroup.cpp index c8f2d48..90617e2 100644 --- a/tabgroup.cpp +++ b/tabgroup.cpp @@ -243,7 +243,7 @@ void TabGroup::setCurrent(Client* c, bool force) void TabGroup::sync(const char *property, Client *c) { if (c->metaObject()->indexOfProperty(property) > -1) { - qWarning("caught attempt to sync non dynamic property: %s", proper= ty); + qCWarning(KWIN_CORE, "caught attempt to sync non dynamic property:= %s", property); return; } QVariant v =3D c->property(property); @@ -286,7 +286,7 @@ void TabGroup::blockStateUpdates(bool more) { more ? ++m_stateUpdatesBlocked : --m_stateUpdatesBlocked; if (m_stateUpdatesBlocked < 0) { m_stateUpdatesBlocked =3D 0; - qWarning("TabGroup: Something is messed up with TabGroup::blockSta= teUpdates() invocation\nReleased more than blocked!"); + qCWarning(KWIN_CORE, "TabGroup: Something is messed up with TabGro= up::blockStateUpdates() invocation\nReleased more than blocked!"); } } = diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f7a08da..d1d0036 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -27,5 +27,5 @@ if (HAVE_INPUT) ${KWIN_SOURCE_DIR}/logind.cpp ) add_executable(libinputtest ${libinputtest_SRCS}) - target_link_libraries(libinputtest Qt5::Core Qt5::DBus Libinput::Libin= put ${UDEV_LIBS}) + target_link_libraries(libinputtest Qt5::Core Qt5::DBus Libinput::Libin= put ${UDEV_LIBS} KF5::WindowSystem) endif() diff --git a/tests/libinputtest.cpp b/tests/libinputtest.cpp index 6c912aa..33582f8 100644 --- a/tests/libinputtest.cpp +++ b/tests/libinputtest.cpp @@ -22,11 +22,14 @@ #include "../logind.h" = #include +#include = #include = #include = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") + int main(int argc, char **argv) { using namespace KWin::LibInput; diff --git a/thumbnailitem.cpp b/thumbnailitem.cpp index d4124ae..f5eb1e1 100644 --- a/thumbnailitem.cpp +++ b/thumbnailitem.cpp @@ -73,7 +73,7 @@ void AbstractThumbnailItem::findParentEffectWindow() if (effects) { QQuickWindow *qw =3D window(); if (!qw) { - qDebug() << "No QQuickWindow assigned yet"; + qCDebug(KWIN_CORE) << "No QQuickWindow assigned yet"; return; } if (auto *w =3D static_cast(effects->findWindow= (qw->winId()))) { diff --git a/toplevel.cpp b/toplevel.cpp index 356bc5c..3fdb9fa 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -382,7 +382,7 @@ void Toplevel::getWmOpaqueRegion() } XFree(data); } else { - qWarning() << "XGetWindowProperty failed"; + qCWarning(KWIN_CORE) << "XGetWindowProperty failed"; break; } } while (bytes_after_return > 0); diff --git a/useractions.cpp b/useractions.cpp index 05b7746..8db0ceb 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -317,7 +317,7 @@ void UserActionsMenu::init() args << QStringLiteral("--icon") << QStringLiteral("prefer= ences-system-windows") << configModules(false); QString error; if (KToolInvocation::kdeinitExec(QStringLiteral("kcmshell5= "), args, &error) !=3D 0) { - qDebug() << "Failed to start kcmshell5: " << error; + qCDebug(KWIN_CORE) << "Failed to start kcmshell5: " <<= error; } } ); @@ -441,7 +441,7 @@ void UserActionsMenu::showHideActivityMenu() { #ifdef KWIN_BUILD_ACTIVITIES const QStringList &openActivities_ =3D Activities::self()->running(); - qDebug() << "activities:" << openActivities_.size(); + qCDebug(KWIN_CORE) << "activities:" << openActivities_.size(); if (openActivities_.size() < 2) { delete m_activityMenu; m_activityMenu =3D 0; @@ -1839,7 +1839,7 @@ void Workspace::slotInvertScreen() continue; } if (gamma->size) { - qDebug() << "inverting screen using XRRSetCrtcGamma"; + qCDebug(KWIN_CORE) << "inverting screen using XRRSetCrtcGa= mma"; const int half =3D gamma->size / 2 + 1; = uint16_t *red =3D gamma.red(); @@ -1872,7 +1872,7 @@ void Workspace::slotInvertScreen() green =3D new unsigned short[size]; blue =3D new unsigned short[size]; if (XF86VidModeGetGammaRamp(display(), scrn, size, red, green, blu= e)) { - qDebug() << "inverting screen using XF86VidModeSetGammaRamp"; + qCDebug(KWIN_CORE) << "inverting screen using XF86VidModeSetGa= mmaRamp"; const int half =3D size / 2 + 1; unsigned short swap; for (int i =3D 0; i < half; ++i) { @@ -1895,13 +1895,13 @@ void Workspace::slotInvertScreen() //BEGIN effect plugin inversion - atm only works with OpenGL and has a= n overhead to it if (effects) { if (Effect *inverter =3D static_cast(effects)= ->provides(Effect::ScreenInversion)) { - qDebug() << "inverting screen using Effect plugin"; + qCDebug(KWIN_CORE) << "inverting screen using Effect plugin"; QMetaObject::invokeMethod(inverter, "toggleScreenInversion", Q= t::DirectConnection); } } = if (!succeeded) - qDebug() << "sorry - neither Xrandr, nor XF86VidModeSetGammaRamp w= orked and there's no inversion supplying effect plugin either"; + qCDebug(KWIN_CORE) << "sorry - neither Xrandr, nor XF86VidModeSetG= ammaRamp worked and there's no inversion supplying effect plugin either"; = } = diff --git a/utils.cpp b/utils.cpp index 856818d..0d2034d 100644 --- a/utils.cpp +++ b/utils.cpp @@ -44,6 +44,7 @@ along with this program. If not, see . = #endif = +Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") namespace KWin { = @@ -135,7 +136,7 @@ void ungrabXKeyboard() { if (!keyboard_grabbed) { // grabXKeyboard() may fail sometimes, so don't fail, but at least= warn anyway - qDebug() << "ungrabXKeyboard() called but keyboard not grabbed!"; + qCDebug(KWIN_CORE) << "ungrabXKeyboard() called but keyboard not g= rabbed!"; } keyboard_grabbed =3D false; xcb_ungrab_keyboard(connection(), XCB_TIME_CURRENT_TIME); diff --git a/utils.h b/utils.h index 6526039..a3cdede 100644 --- a/utils.h +++ b/utils.h @@ -30,13 +30,14 @@ along with this program. If not, see . // KDE #include // Qt +#include #include #include #include #include // system #include - +Q_DECLARE_LOGGING_CATEGORY(KWIN_CORE) namespace KWin { = diff --git a/wayland_backend.cpp b/wayland_backend.cpp index a8baf6b..a486c27 100644 --- a/wayland_backend.cpp +++ b/wayland_backend.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #include "cursor.h" #include "input.h" #include "main.h" +#include "utils.h" #include #include #include @@ -520,7 +521,7 @@ WaylandBackend::~WaylandBackend() m_connectionThread->quit(); m_connectionThread->wait(); = - qDebug() << "Destroyed Wayland display"; + qCDebug(KWIN_CORE) << "Destroyed Wayland display"; s_self =3D NULL; } = diff --git a/workspace.cpp b/workspace.cpp index 85c484f..8f572d7 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -766,7 +766,7 @@ bool Workspace::waitForCompositingSetup() = void Workspace::slotReconfigure() { - qDebug() << "Workspace::slotReconfigure()"; + qCDebug(KWIN_CORE) << "Workspace::slotReconfigure()"; reconfigureTimer.stop(); = bool borderlessMaximizedWindows =3D options->borderlessMaximizedWindow= s(); diff --git a/xcbutils.cpp b/xcbutils.cpp index c83065a..504543f 100644 --- a/xcbutils.cpp +++ b/xcbutils.cpp @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public= License along with this program. If not, see . *********************************************************************/ #include "xcbutils.h" +#include "utils.h" // Qt #include // xcb @@ -467,7 +468,7 @@ void Extensions::init() if (m_sync.present) { initVersion(syncVersion, &xcb_sync_in= itialize_reply, &m_sync); } - qDebug() << "Extensions: shape: 0x" << QString::number(m_shape.version= , 16) + qCDebug(KWIN_CORE) << "Extensions: shape: 0x" << QString::number(m_sha= pe.version, 16) << " composite: 0x" << QString::number(m_composite.versio= n, 16) << " render: 0x" << QString::number(m_render.version, 16) << " fixes: 0x" << QString::number(m_fixes.version, 16) @@ -579,25 +580,25 @@ bool Shm::init() { const xcb_query_extension_reply_t *ext =3D xcb_get_extension_data(conn= ection(), &xcb_shm_id); if (!ext || !ext->present) { - qDebug() << "SHM extension not available"; + qCDebug(KWIN_CORE) << "SHM extension not available"; return false; } ScopedCPointer version(xcb_shm_query_ve= rsion_reply(connection(), xcb_shm_query_version_unchecked(connection()), NULL)); if (version.isNull()) { - qDebug() << "Failed to get SHM extension version information"; + qCDebug(KWIN_CORE) << "Failed to get SHM extension version informa= tion"; return false; } m_pixmapFormat =3D version->pixmap_format; const int MAXSIZE =3D 4096 * 2048 * 4; // TODO check there are not lar= ger windows m_shmId =3D shmget(IPC_PRIVATE, MAXSIZE, IPC_CREAT | 0600); if (m_shmId < 0) { - qDebug() << "Failed to allocate SHM segment"; + qCDebug(KWIN_CORE) << "Failed to allocate SHM segment"; return false; } m_buffer =3D shmat(m_shmId, NULL, 0 /*read/write*/); if (-1 =3D=3D reinterpret_cast(m_buffer)) { - qDebug() << "Failed to attach SHM segment"; + qCDebug(KWIN_CORE) << "Failed to attach SHM segment"; shmctl(m_shmId, IPC_RMID, NULL); return false; } @@ -607,7 +608,7 @@ bool Shm::init() const xcb_void_cookie_t cookie =3D xcb_shm_attach_checked(connection()= , m_segment, m_shmId, false); ScopedCPointer error(xcb_request_check(connection= (), cookie)); if (!error.isNull()) { - qDebug() << "xcb_shm_attach error: " << error->error_code; + qCDebug(KWIN_CORE) << "xcb_shm_attach error: " << error->error_cod= e; shmdt(m_buffer); return false; }