[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kwin] /: Introduce categorized logging for kwin core
From: Martin_Gräßlin <mgraesslin () kde ! org>
Date: 2014-12-05 13:29:14
Message-ID: E1Xwswc-0003kJ-Bv () scm ! kde ! org
[Download RAW message or body]
Git commit 0d997b10936563eb770b22e1c96ecace5a899512 by Martin Gräßlin, 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 flags)
if (c->tabGroup() && c->tabGroup()->current() != c)
c->tabGroup()->setCurrent(c);
if (!c->isShown(true)) { // shouldn't happen, call activateClient() if needed
- qWarning() << "takeActivity: not shown" ;
+ qCWarning(KWIN_CORE) << "takeActivity: not shown" ;
return;
}
@@ -565,18 +565,18 @@ bool Workspace::allowClientActivation(const KWin::Client *c, \
xcb_timestamp_t tim if (!ignore_desktop && !c->isOnCurrentDesktop())
return false; // allow only with level == 0
if (ac == 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 == 3) // high
return false;
if (time == -1U) { // no time known
- qDebug() << "Activation: No timestamp at all";
+ qCDebug(KWIN_CORE) << "Activation: No timestamp at all";
if (level == 1) // low
return true;
// no timestamp at all, don't activate - because there's also creation timestamp
@@ -586,7 +586,7 @@ bool Workspace::allowClientActivation(const KWin::Client *c, \
xcb_timestamp_t tim }
// level == 2 // normal
Time user_time = ac->userTime();
- qDebug() << "Activation, compared:" << c << ":" << time << ":" << user_time
+ qCDebug(KWIN_CORE) << "Activation, compared:" << c << ":" << time << ":" << user_time
<< ":" << (NET::timestampCompare(time, user_time) >= 0) << endl;
return NET::timestampCompare(time, user_time) >= 0; // time >= user_time
}
@@ -607,18 +607,18 @@ bool Workspace::allowFullClientRaising(const KWin::Client *c, \
xcb_timestamp_t ti if (level == 4) // extreme
return false;
if (ac == 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 == 3) // high
return false;
xcb_timestamp_t user_time = ac->userTime();
- qDebug() << "Raising, compared:" << time << ":" << user_time
+ qCDebug(KWIN_CORE) << "Raising, compared:" << time << ":" << user_time
<< ":" << (NET::timestampCompare(time, user_time) >= 0) << endl;
return NET::timestampCompare(time, user_time) >= 0; // time >= user_time
}
@@ -707,7 +707,7 @@ xcb_timestamp_t Client::readUserTimeMapTimestamp(const KStartupInfoId \
*asn_id, c time = asn_id->timestamp();
}
}
- qDebug() << "User timestamp, ASN:" << time;
+ qCDebug(KWIN_CORE) << "User timestamp, ASN:" << time;
if (time == -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->focusStealingPreventionLevel()) > \
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 = 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<QByteArray> saveSessionIds;
QSet<QByteArray> 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.KSMServerInterface");
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_builtin_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_machine.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 <http://www.gnu.org/licenses/>.
#include <sys/socket.h>
#include <netdb.h>
+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_scripted_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 = nullptr;
diff --git a/autotests/test_xrandr_screens.cpp b/autotests/test_xrandr_screens.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 <http://www.gnu.org/licenses/>.
// Qt
#include <QtTest/QtTest>
+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 = 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 = nullptr;
killProcess(true, m_pingTimestamp);
@@ -1332,7 +1332,7 @@ void Client::killProcess(bool ask, xcb_timestamp_t timestamp)
pid_t pid = info->pid();
if (pid <= 0 || clientMachine()->hostName().isEmpty()) // Needed properties 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 reacting
QStringList allActivities = 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 and we don't wanna \
make it worse return;
}
for (int i = 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 <http://www.gnu.org/licenses/>.
*********************************************************************/
// own
#include "client_machine.h"
+#include "utils.h"
// KF5
#include <KWindowInfo>
// Qt
@@ -120,7 +121,7 @@ bool GetAddrInfo::resolved(QFutureWatcher< int >* watcher)
return false;
}
if (watcher->result() != 0) {
- qDebug() << "getaddrinfo failed with error:" << gai_strerror(watcher->result());
+ qCDebug(KWIN_CORE) << "getaddrinfo failed with error:" << \
gai_strerror(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:" << reasons;
return;
} else if (!CompositingPrefs::compositingPossible()) {
- qCritical() << "Compositing is not possible";
+ qCCritical(KWIN_CORE) << "Compositing is not possible";
return;
}
m_starting = 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 = KSharedConfig::openConfig();
KConfigGroup unsafeConfig(unsafeConfigPtr, "Compositing");
const QString openGLIsUnsafe = QStringLiteral("OpenGLIsUnsafe") + (is_multihead ? \
QString::number(screen_number) : QString()); if (unsafeConfig.readEntry(openGLIsUnsafe, \
false))
- qWarning() << "KWin has detected that your OpenGL library is unsafe to use";
+ qCWarning(KWIN_CORE) << "KWin has detected that your OpenGL library 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 = SceneXrender::createScene();
break;
#endif
case QPainterCompositing:
- qDebug() << "Initializing QPainter compositing";
+ qCDebug(KWIN_CORE) << "Initializing QPainter compositing";
m_scene = SceneQPainter::createScene();
break;
default:
- qDebug() << "No compositing enabled";
+ qCDebug(KWIN_CORE) << "No compositing enabled";
m_starting = false;
cm_selection->owning = 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 compositing";
+ qCCritical(KWIN_CORE) << "We are going to quit KWin now as it is broken";
qApp->quit();
}
return;
}
if (m_scene == NULL || m_scene->initFailed()) {
- qCritical() << "Failed to initialize compositing, compositing disabled";
+ qCCritical(KWIN_CORE) << "Failed to initialize compositing, compositing disabled";
delete m_scene;
m_scene = NULL;
m_starting = false;
cm_selection->owning = 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 compositing";
+ 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 = false;
cm_selection->release();
}
@@ -1105,10 +1105,10 @@ bool Toplevel::updateUnredirectedState()
lastUnredirect.start();
unredirect = should;
if (unredirect) {
- qDebug() << "Unredirecting:" << this;
+ qCDebug(KWIN_CORE) << "Unredirecting:" << this;
xcb_composite_unredirect_window(connection(), frameId(), \
XCB_COMPOSITE_REDIRECT_MANUAL); } else {
- qDebug() << "Redirecting:" << this;
+ qCDebug(KWIN_CORE) << "Redirecting:" << this;
xcb_composite_redirect_window(connection(), frameId(), XCB_COMPOSITE_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 <http://www.gnu.org/licenses/>.
#include "main.h"
#include "xcbutils.h"
#include "kwinglplatform.h"
+#include "utils.h"
#include <kconfiggroup.h>
#include <KLocalizedString>
@@ -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 != 0)
- qCritical() << "Deleted client has non-zero reference count (" << delete_refcount << \
")"; + qCCritical(KWIN_CORE) << "Deleted client has non-zero reference count (" << \
delete_refcount << ")"; assert(delete_refcount == 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 <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include "effects/effect_builtins.h"
#include "scripting/scriptedeffect.h"
+#include "utils.h"
// KDE
#include <KConfigGroup>
#include <KPluginTrader>
@@ -129,7 +130,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &name, 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 &name, 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 effect: " << name;
return false;
}
}
@@ -156,7 +157,7 @@ bool BuiltInEffectLoader::loadEffect(const QString &name, BuiltInEffect \
effect, // ok, now we can try to create the Effect
Effect *e = 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 &name, 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 effect, \
LoadEffectFlags flag {
const QString name = 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 = 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 effect, 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(const KPluginInfo &info) \
const }
KPluginLoader loader(info.libraryPath());
if (loader.pluginVersion() != 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 plugin version, expected " << KWIN_EFFECT_API_VERSION \
<< "got " << loader.pluginVersion(); return nullptr;
}
KPluginFactory *factory = loader.factory();
if (!factory) {
- qDebug() << "Did not get KPluginFactory for " << info.pluginName();
+ qCDebug(KWIN_CORE) << "Did not get KPluginFactory for " << info.pluginName();
return nullptr;
}
return dynamic_cast< EffectPluginFactory* >(factory);
@@ -361,21 +362,21 @@ bool PluginEffectLoader::loadEffect(const QString &name)
bool PluginEffectLoader::loadEffect(const KPluginInfo &info, LoadEffectFlags flags)
{
if (!info.isValid()) {
- qDebug() << "Plugin info is not valid";
+ qCDebug(KWIN_CORE) << "Plugin info is not valid";
return false;
}
const QString name = 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 = 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 effect: " << 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 = 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 = effect_order.begin(); it != \
effect_order.end(); ++it) { if (it.value().first == name) {
- qDebug() << "EffectsHandler::unloadEffect : Unloading Effect : " << name;
+ qCDebug(KWIN_CORE) << "EffectsHandler::unloadEffect : Unloading Effect : " << \
name; if (activeFullScreenEffect() == it.value().second) {
setActiveFullScreenEffect(0);
}
@@ -1324,7 +1324,7 @@ void EffectsHandlerImpl::unloadEffect(const QString& name)
}
}
- qDebug() << "EffectsHandler::unloadEffect : Effect not loaded : " << name;
+ qCDebug(KWIN_CORE) << "EffectsHandler::unloadEffect : Effect not loaded : " << 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->display() ? "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 productive usage!";
- qWarning() << "Please do not report any issues you might encounter when 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 encounter when \
using this backend!"; }
EglWaylandBackend::~EglWaylandBackend()
@@ -108,20 +108,20 @@ bool EglWaylandBackend::initializeEgl()
return false;
EGLint error = eglGetError();
if (error != 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) == 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 == 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 = 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 = eglCreateWindowSurface(m_display, m_config, m_overlay, nullptr);
if (m_surface == 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) == EGL_FALSE) {
- qCritical() << "Make Context Current failed";
+ qCCritical(KWIN_CORE) << "Make Context Current failed";
return false;
}
EGLint error = eglGetError();
if (error != 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) == EGL_FALSE) {
- qCritical() << "choose config failed";
+ qCCritical(KWIN_CORE) << "choose config failed";
return false;
}
if (count != 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 = 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 = false;
m_swapProfiler.init();
if (surfaceHasSubPost) {
- qDebug() << "EGL implementation and surface support eglPostSubBufferNV, let's use it";
+ qCDebug(KWIN_CORE) << "EGL implementation and surface support eglPostSubBufferNV, \
let's use it";
if (options->glPreferBufferSwap() != 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 >= 1) {
if (eglSwapInterval(dpy, 1)) {
- qDebug() << "Enabled v-sync";
+ qCDebug(KWIN_CORE) << "Enabled v-sync";
setSyncsToVBlank(true);
const QByteArray tripleBuffer = qgetenv("KWIN_TRIPLE_BUFFER");
if (!tripleBuffer.isEmpty()) {
@@ -140,7 +140,7 @@ void EglOnXBackend::init()
gs_tripleBufferNeedsDetection = gs_tripleBufferUndetected;
}
} 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 buffer 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_PRESERVED);
}
}
@@ -198,7 +198,7 @@ bool EglOnXBackend::initRenderingContext()
eglBindAPI(EGL_OPENGL_ES_API);
#else
if (eglBindAPI(EGL_OPENGL_API) == 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 == EGL_NO_CONTEXT) {
- qCritical() << "Create Context failed";
+ qCCritical(KWIN_CORE) << "Create Context failed";
return false;
}
if (eglMakeCurrent(dpy, surface, surface, ctx) == 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 = eglGetError();
if (error != 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) == 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 = 0; i < count; i++) {
EGLint val;
if (eglGetConfigAttrib(dpy, configs[i], EGL_NATIVE_VISUAL_ID, &val) == EGL_FALSE) {
- qCritical() << "egl get config attrib failed";
+ qCCritical(KWIN_CORE) << "egl get config attrib failed";
}
if (uint32_t(val) == attribs->visual) {
config = 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=\"USLEEP\" to prevent \
large CPU overhead on synced swaps\n"
"Preferably, enable the TripleBuffer Option in the \
xorg.conf Device\n"
"For this reason, the tearing prevention has been \
disabled.\n" @@ -515,7 +515,7 @@ bool EglTexture::loadTexture(xcb_pixmap_t pix, const QSize \
&size, xcb_visualid_t (EGLClientBuffer)pix, attribs);
if (EGL_NO_IMAGE_KHR == 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 = 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, resource 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 = Screens::self();
int nscreens = s->count();
const int numberOfDesktops = VirtualDesktopManager::self()->count();
- qDebug() << "screens: " << nscreens << "desktops: " << numberOfDesktops;
+ qCDebug(KWIN_CORE) << "screens: " << nscreens << "desktops: " << numberOfDesktops;
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 = 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, Sizemode mode, bool \
noframe) int w = wsize.width();
int h = wsize.height();
if (w < 1 || h < 1) {
- qWarning() << "sizeForClientSize() with empty size!" ;
+ qCWarning(KWIN_CORE) << "sizeForClientSize() with empty size!" ;
}
if (w < 1) w = 1;
if (h < 1) h = 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 resize 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|CWHeight)) <<
bool(maximizeMode() & MaximizeVertical) <<
bool(maximizeMode() & MaximizeHorizontal);
@@ -1638,11 +1638,11 @@ void Client::configureRequest(int value_mask, int rx, 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|CWWidth|CWY|CWHeight));
if (gravity == 0) // default (nonsense) value for the argument
gravity = xSizeHint.win_gravity;
@@ -1735,7 +1735,7 @@ void Client::resizeWithChecks(int w, int h, ForceGeometry_t force)
assert(!shade_geometry_change);
if (isShade()) {
if (h == borderTop() + borderBottom()) {
- qWarning() << "Shaded geometry passed for size:" ;
+ qCWarning(KWIN_CORE) << "Shaded geometry passed for size:" ;
}
}
int newx = 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 == borderTop() + borderBottom()) {
- qDebug() << "Shaded geometry passed for size:";
+ qCDebug(KWIN_CORE) << "Shaded geometry passed for size:";
} else {
client_size = QSize(w - borderLeft() - borderRight(), h - borderTop() - \
borderBottom()); h = 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 == 0 && g != rules()->checkGeometry(g)) {
- qDebug() << "forced geometry fail:" << g << ":" << rules()->checkGeometry(g);
+ qCDebug(KWIN_CORE) << "forced geometry fail:" << g << ":" << \
rules()->checkGeometry(g); }
if (force == NormalGeometrySet && geom == g && pending_geometry_update == \
PendingGeometryNone) return;
@@ -1975,7 +1975,7 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
; // nothing
else if (isShade()) {
if (h == borderTop() + borderBottom()) {
- qDebug() << "Shaded geometry passed for size:";
+ qCDebug(KWIN_CORE) << "Shaded geometry passed for size:";
} else {
client_size = QSize(w - borderLeft() - borderRight(), h - borderTop() - \
borderBottom()); h = borderTop() + borderBottom();
@@ -1985,7 +1985,7 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
}
QSize s(w, h);
if (block_geometry_updates == 0 && s != 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 == PendingGeometryNone || block_geometry_updates > 0);
@@ -2039,7 +2039,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
assert(pending_geometry_update == PendingGeometryNone || block_geometry_updates > 0);
QPoint p(x, y);
if (block_geometry_updates == 0 && p != rules()->checkPosition(p)) {
- qDebug() << "forced position fail:" << p << ":" << rules()->checkPosition(p);
+ qCDebug(KWIN_CORE) << "forced position fail:" << p << ":" << \
rules()->checkPosition(p); }
if (force == NormalGeometrySet && geom.topLeft() == p)
return;
@@ -2457,7 +2457,7 @@ void Client::updateFullscreenMonitors(NETFullscreenMonitors topology)
topology.bottom >= nscreens ||
topology.left >= nscreens ||
topology.right >= nscreens) {
- qWarning() << "fullscreenMonitors update failed. request higher than 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 = 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 glXWaitVideoSync 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 = glXGetVisualFromFBConfig(display(), fbconfig);
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 == NULL) {
- qCritical() << "Failed to find a usable framebuffer configuration";
+ qCCritical(KWIN_CORE) << "Failed to find a usable framebuffer configuration";
return false;
}
@@ -416,7 +416,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
const xcb_render_directformat_t *direct = XRenderUtils::findPictFormatInfo(format);
if (!direct) {
- qCritical().nospace() << "Could not find a picture format for visual 0x" << hex << \
visual; + qCCritical(KWIN_CORE).nospace() << "Could not find a picture format for visual \
0x" << hex << visual; return info;
}
@@ -449,7 +449,7 @@ FBConfigInfo *GlxBackend::infoForVisual(xcb_visualid_t visual)
GLXFBConfig *configs = glXChooseFBConfig(display(), DefaultScreen(display()), attribs, \
&count);
if (count < 1) {
- qCritical().nospace() << "Could not find a framebuffer configuration for visual 0x" << \
hex << visual; + qCCritical(KWIN_CORE).nospace() << "Could not find a framebuffer \
configuration 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 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=\"USLEEP\" to \
prevent large CPU overhead on synced swaps\n"
"Preferably, enable the TripleBuffer Option in \
the xorg.conf Device\n"
"For this reason, the tearing 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 == NULL) {
- qDebug() << "TC: " << *it1 << " in not in a group" << endl;
+ qCDebug(KWIN_CORE) << "TC: " << *it1 << " in not in a group" << endl;
ret = false;
} else if (!(*it1)->in_group->members().contains(*it1)) {
- qDebug() << "TC: " << *it1 << " has a group " << (*it1)->in_group << " but group \
does not contain it" << endl; + qCDebug(KWIN_CORE) << "TC: " << *it1 << " has a \
group " << (*it1)->in_group << " but group does not contain it" << endl; ret = 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 = 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 client ";
- qDebug() << "TC2:" << *it2; // this may crash
+ qCDebug(KWIN_CORE) << "TC:" << *it1 << " has non-existent main client ";
+ qCDebug(KWIN_CORE) << "TC2:" << *it2; // this may crash
ret = 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 = false;
continue;
}
@@ -130,7 +130,7 @@ bool performTransiencyCheck()
it2 != members.constEnd();
++it2) {
if ((*it2)->in_group != *it1) {
- qDebug() << "TC: Group " << *it1 << " contains client " << *it2 << " but \
client is not in that group" << endl; + qCDebug(KWIN_CORE) << "TC: Group " << \
*it1 << " contains client " << *it2 << " but client is not in that group" << endl; ret = \
false; }
}
@@ -155,8 +155,8 @@ static void checkTransiency()
{
if (--transiencyCheck == 0) {
if (!performTransiencyCheck()) {
- qDebug() << "BT:" << transiencyCheckStartBt << endl;
- qDebug() << "CLIENT:" << transiencyCheckClient << endl;
+ qCDebug(KWIN_CORE) << "BT:" << transiencyCheckStartBt << endl;
+ qCDebug(KWIN_CORE) << "CLIENT:" << transiencyCheckClient << endl;
abort();
}
transiencyCheckNonExistent = false;
@@ -736,7 +736,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, \
bool set }
if (new_transient_for == 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_FOR poiting to \
itself." ; new_property_value = new_transient_for = rootWindow();
}
// The transient_for window may be embedded in another application,
@@ -754,7 +754,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, \
bool set }
if (Client* new_transient_for_client = workspace()->findClient(Predicate::WindowMatch, \
new_transient_for)) { if (new_transient_for != before_search) {
- qDebug() << "Client " << this << " has WM_TRANSIENT_FOR poiting to non-toplevel \
window " + qCDebug(KWIN_CORE) << "Client " << this << " has WM_TRANSIENT_FOR poiting \
to non-toplevel window "
<< before_search << ", child of " << new_transient_for_client << ", \
adjusting." << endl;
new_property_value = new_transient_for; // also fix the property
}
@@ -771,7 +771,7 @@ xcb_window_t Client::verifyTransientFor(xcb_window_t new_transient_for, \
bool set break;
loop_pos = pos->m_transientForId;
if (--count == 0 || pos == this) {
- qWarning() << "Client " << this << " caused WM_TRANSIENT_FOR loop." ;
+ qCWarning(KWIN_CORE) << "Client " << this << " caused WM_TRANSIENT_FOR loop." ;
new_transient_for = 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 = 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 = 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 = true;
const bool force = (qstrcmp(qgetenv("KWIN_FORCE_LANCZOS"), "1") == 0);
if (force) {
- qWarning() << "Lanczos Filter forced on by environment variable";
+ qCWarning(KWIN_CORE) << "Lanczos Filter forced on by environment variable";
}
if (!force && options->glSmoothScale() != 2)
@@ -94,7 +94,7 @@ void LanczosFilter::init()
m_uKernel = m_shader->uniformLocation("kernel");
m_uOffsets = 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_new_clients)
force_restacking = false;
stacking_order = new_stacking_order;
#if 0
- qDebug() << "stacking:" << changed;
+ qCDebug(KWIN_CORE) << "stacking:" << changed;
if (changed || propagate_new_clients) {
for (ClientList::ConstIterator it = stacking_order.begin();
it != stacking_order.end();
++it)
- qDebug() << (void*)(*it) << *it << ":" << (*it)->layer();
+ qCDebug(KWIN_CORE) << (void*)(*it) << *it << ":" << (*it)->layer();
}
#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 = unconstrained_stacking_order.begin();
it != 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<Group*, Layer> > minimum_layer(screens()->count());
@@ -524,11 +524,11 @@ ToplevelList Workspace::constrainedStackingOrder()
++lay)
stacking += layer[ lay ];
#if 0
- qDebug() << "stacking2:";
+ qCDebug(KWIN_CORE) << "stacking2:";
for (ClientList::ConstIterator it = stacking.begin();
it != 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 = stacking.begin();
it != 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 <http://www.gnu.org/licenses/>.
#include <sys/stat.h>
#include <unistd.h>
+#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 = reply.value().path();
- qDebug() << "Session path:" << m_sessionPath;
+ qCDebug(KWIN_CORE) << "Session path:" << m_sessionPath;
m_connected = true;
connectSessionPropertiesChanged();
getSessionActive();
@@ -157,7 +158,7 @@ void LogindIntegration::getSessionActive()
QDBusPendingReply<QVariant> reply = *self;
self->deleteLater();
if (!reply.isValid()) {
- qDebug() << "Failed to get Active Property of logind session:" << \
reply.error().message(); + qCDebug(KWIN_CORE) << "Failed to get Active Property \
of logind session:" << reply.error().message(); return;
}
const bool active = reply.value().toBool();
@@ -187,11 +188,11 @@ void LogindIntegration::takeControl()
QDBusPendingReply<void> reply = *self;
self->deleteLater();
if (!reply.isValid()) {
- qDebug() << "Failed to get session control" << reply.error().message();
+ qCDebug(KWIN_CORE) << "Failed to get session control" << \
reply.error().message(); emit hasSessionControlChanged(false);
return;
}
- qDebug() << "Gained session control";
+ qCDebug(KWIN_CORE) << "Gained session control";
m_sessionControl = 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 = QDBusMessage::createMethodCall(s_login1Service,
@@ -228,7 +229,7 @@ int LogindIntegration::takeDevice(const char *path)
// intended to be a blocking call
QDBusMessage reply = m_bus.call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {
- qDebug() << "Could not take device" << path << ", cause: " << reply.errorMessage();
+ qCDebug(KWIN_CORE) << "Could not take device" << path << ", cause: " << \
reply.errorMessage(); return -1;
}
return dup(reply.arguments().first().value<QDBusUnixFileDescriptor>().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 = QDBusMessage::createMethodCall(s_login1Service,
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 = 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 >= 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 compositing";
KConfigGroup compgroup(KSharedConfig::openConfig(), "Compositing");
compgroup.writeEntry("Enabled", false);
}
@@ -343,7 +343,8 @@ void Application::setupLocalizedString()
void Application::setupLoggingCategoryFilters()
{
QLoggingCategory::setFilterRules(QStringLiteral("aurorae.debug = true\n") +
- QStringLiteral("kwineffects.debug = true"));
+ QStringLiteral("kwineffects.debug = true\n") +
+ QStringLiteral("kwin_core.debug = true"));
}
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<xcb_generic_error_t> error(xcb_request_check(connection(),
xcb_configure_window_checked(connection(), supportWindow, \
XCB_CONFIG_WINDOW_STACK_MODE, lowerValues))); if (!error.isNull()) {
- qDebug() << "Error occurred while lowering support window: " << error->error_code;
+ qCDebug(KWIN_CORE) << "Error occurred while lowering support window: " << \
error->error_code; }
const NET::Properties properties = 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 <http://www.gnu.org/licenses/>.
#include "options.h"
#include "config-kwin.h"
+#include "utils.h"
#ifndef KCMRULES
@@ -65,7 +66,7 @@ int currentRefreshRate()
vtotal *= 2;
if (modeline.htotal*vtotal) // BUG 313996
rate = 1000*dotclock/(modeline.htotal*vtotal); // WTF 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 = -1;
else
rate = 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 = 1000;
- qDebug() << "Vertical Refresh rate " << rate << "Hz";
+ qCDebug(KWIN_CORE) << "Vertical Refresh rate " << rate << "Hz";
return rate;
}
@@ -784,24 +785,24 @@ void Options::setGlPlatformInterface(OpenGLPlatformInterface interface)
const QByteArray envOpenGLInterface(qgetenv("KWIN_OPENGL_INTERFACE"));
if (!envOpenGLInterface.isEmpty()) {
if (qstrcmp(envOpenGLInterface, "egl") == 0) {
- qDebug() << "Forcing EGL native interface through environment variable";
+ qCDebug(KWIN_CORE) << "Forcing EGL native interface through environment variable";
interface = EglPlatformInterface;
} else if (qstrcmp(envOpenGLInterface, "glx") == 0) {
- qDebug() << "Forcing GLX native interface through environment variable";
+ qCDebug(KWIN_CORE) << "Forcing GLX native interface through environment variable";
interface = GlxPlatformInterface;
}
}
if (kwinApp()->shouldUseWaylandForCompositing() && interface == GlxPlatformInterface) {
// Glx is impossible on Wayland, enforce egl
- qDebug() << "Forcing EGL native interface for Wayland mode";
+ qCDebug(KWIN_CORE) << "Forcing EGL native interface for Wayland mode";
interface = EglPlatformInterface;
}
#ifdef KWIN_HAVE_OPENGLES
- qDebug() << "Forcing EGL native interface as compiled against OpenGL ES";
+ qCDebug(KWIN_CORE) << "Forcing EGL native interface as compiled against OpenGL ES";
interface = EglPlatformInterface;
#else
#ifndef KWIN_HAVE_EGL
- qDebug() << "Forcing GLX native interface as compiled without EGL support";
+ qCDebug(KWIN_CORE) << "Forcing GLX native interface as compiled without EGL support";
interface = GlxPlatformInterface;
#endif
#endif
@@ -934,29 +935,29 @@ bool Options::loadCompositingConfig (bool force)
if (const char *c = 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 environment variable";
compositingMode = OpenGLCompositing;
useCompositing = true;
break;
case 'X':
- qDebug() << "Compositing forced to XRender mode by environment variable";
+ qCDebug(KWIN_CORE) << "Compositing forced to XRender mode by environment \
variable"; compositingMode = XRenderCompositing;
useCompositing = true;
break;
case 'Q':
- qDebug() << "Compositing forced to QPainter mode by environment variable";
+ qCDebug(KWIN_CORE) << "Compositing forced to QPainter mode by environment \
variable"; compositingMode = QPainterCompositing;
useCompositing = true;
break;
case 'N':
if (getenv("KDE_FAILSAFE"))
- qDebug() << "Compositing disabled forcefully by KDE failsafe mode";
+ qCDebug(KWIN_CORE) << "Compositing disabled forcefully by KDE failsafe mode";
else
- qDebug() << "Compositing disabled forcefully by environment variable";
+ qCDebug(KWIN_CORE) << "Compositing disabled forcefully by environment \
variable"; compositingMode = 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 = QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
QStringLiteral(KWIN_NAME) + QStringLiteral("/outline/plasma/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->errors();
+ qCDebug(KWIN_CORE) << "Component failed to load: " << m_qmlComponent->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 = *it;
- qDebug() << "Rule found:" << rule << ":" << c;
+ qCDebug(KWIN_CORE) << "Rule found:" << rule << ":" << c;
if (rule->isTemporary())
it = 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 = xcb_request_check(connection(), namePixmapCookie)) {
- 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 != XCB_MAP_STATE_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 != toplevel()->width() || windowGeometry->height != \
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 != 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 = 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: " << reason;
m_failed = 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_ARB_texture_rectangle \
missing"; init_ok = false;
return; // error
}
#endif
if (glPlatform->isMesaDriver() && glPlatform->mesaVersion() < kVersionNumber(8, 0)) {
- qCritical() << "KWin requires at least Mesa 8.0 for OpenGL compositing.";
+ qCCritical(KWIN_CORE) << "KWin requires at least Mesa 8.0 for OpenGL compositing.";
init_ok = false;
return;
}
@@ -398,10 +398,10 @@ SceneOpenGL::SceneOpenGL(Workspace* ws, OpenGLBackend *backend)
const QByteArray useExplicitSync = qgetenv("KWIN_EXPLICIT_SYNC");
if (useExplicitSync != "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 = new SyncManager;
} else {
- qDebug() << "Explicit synchronization with the X command stream disabled by \
environment variable"; + qCDebug(KWIN_CORE) << "Explicit synchronization with the X \
command 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() == XRenderCompositing) {
- qCritical() << "OpenGL driver recommends XRender based compositing. 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 based compositing. Falling back to \
XRender."; + qCCritical(KWIN_CORE) << "To overwrite the detection use the \
environment variable KWIN_COMPOSE"; + qCCritical(KWIN_CORE) << "For more information \
see http://community.kde.org/KWin/Environment_Variables#KWIN_COMPOSE";
QTimer::singleShot(0, Compositor::self(), SLOT(fallbackToXRenderCompositing()));
}
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 context occurred.";
+ qCDebug(KWIN_CORE) << "A graphics reset attributable to the current GL context \
occurred."; break;
case GL_INNOCENT_CONTEXT_RESET_KWIN:
- qDebug() << "A graphics reset not attributable to the current GL context occurred.";
+ qCDebug(KWIN_CORE) << "A graphics reset not attributable to the current 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 occurred.";
break;
default:
@@ -603,7 +603,7 @@ void SceneOpenGL::handleGraphicsReset(GLenum status)
while (timer.elapsed() < 10000 && glGetGraphicsResetStatus() != GL_NO_ERROR)
usleep(50);
- qDebug() << "Attempting to reset compositing.";
+ qCDebug(KWIN_CORE) << "Attempting to reset compositing.";
QMetaObject::invokeMethod(this, "resetCompositing", Qt::QueuedConnection);
KNotification::event(QStringLiteral("graphicsreset"), i18n("Desktop effects 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 command 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 unsynchronized.";
delete m_syncManager;
m_syncManager = nullptr;
}
@@ -884,7 +884,7 @@ bool SceneOpenGL2::supported(OpenGLBackend *backend)
const QByteArray forceEnv = qgetenv("KWIN_COMPOSE");
if (!forceEnv.isEmpty()) {
if (qstrcmp(forceEnv, "O2") == 0) {
- qDebug() << "OpenGL 2 compositing enforced by environment variable";
+ qCDebug(KWIN_CORE) << "OpenGL 2 compositing enforced by environment 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() < OpenGL2Compositing) {
- qDebug() << "Driver does not recommend OpenGL 2 compositing";
+ qCDebug(KWIN_CORE) << "Driver does not recommend OpenGL 2 compositing";
#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 = 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 = 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 = false;
return;
}
- qDebug() << "OpenGL 2 compositing successfully initialized";
+ qCDebug(KWIN_CORE) << "OpenGL 2 compositing successfully initialized";
init_ok = 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 = (10*m_time + m_timer.nsecsElapsed())/11;
if (++m_counter > 500) {
const bool blocks = m_time > 1000 * 1000; // 1ms, i get ~250 µs and ~7ms w/o triple \
buffering...
- qDebug() << "Triple buffering detection:" << QString(blocks ? QStringLiteral("NOT \
available") : QStringLiteral("Available")) << + qCDebug(KWIN_CORE) << "Triple buffering \
detection:" << QString(blocks ? 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: " << reason;
m_failed = true;
}
@@ -150,7 +150,7 @@ void WaylandQPainterBackend::prepareRenderingFrame()
const QSize size(Wayland::WaylandBackend::self()->shellSurfaceSize());
m_buffer = Wayland::WaylandBackend::self()->shmPool()->getBuffer(size, 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 = QImage();
return;
}
@@ -159,7 +159,7 @@ void WaylandQPainterBackend::prepareRenderingFrame()
m_backBuffer = QImage(b->address(), size.width(), size.height(), QImage::Format_RGB32);
m_backBuffer.fill(Qt::transparent);
m_needsFullRepaint = 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 = m_backBuffer.size();
m_backBuffer = QImage(b->address(), size.width(), size.height(), QImage::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 <http://www.gnu.org/licenses/>.
*********************************************************************/
#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 buffer)
void XRenderBackend::setFailed(const QString& reason)
{
- qCritical() << "Creating the XRender backend failed: " << reason;
+ qCCritical(KWIN_CORE) << "Creating the XRender backend failed: " << reason;
m_failed = true;
}
@@ -270,7 +272,7 @@ void WaylandXRenderBackend::createBuffer()
xcb_free_pixmap(connection(), pixmap); // The picture owns the pixmap 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 QRegion &damage)
const QSize &size = wl->shellSurfaceSize();
auto buffer = 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 <http://www.gnu.org/licenses/>.
#include "wayland_backend.h"
#include <KWayland/Client/output.h>
+#include "utils.h"
#include "xcbutils.h"
#include <QDebug>
@@ -115,7 +116,7 @@ static bool setNewScreenSize(const QSize &size)
auto c = xcb_randr_set_screen_size_checked(connection(), rootWindow(), size.width(), \
size.height(), 1, 1);
ScopedCPointer<xcb_generic_error_t> 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->error_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_current_reply_t* r)
{
if (xcb_randr_get_screen_resources_current_crtcs_length(r) == 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_crtc_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 &size, const \
xcb_randr_get_sc for (int i = 0; i < modeInfoLength; ++i) {
xcb_randr_mode_info_t modeInfo = infos[i];
if (modeInfo.width == size.width() && modeInfo.height == size.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 = xcb_randr_add_output_mode_checked(connection(), output, mode);
ScopedCPointer<xcb_generic_error_t> 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: " << error->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 with 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, QSet<QByteArray> \
sessionIds if (!sessionIds.contains(sessionId))
continue;
- qDebug() << "storing" << sessionId;
+ qCDebug(KWIN_CORE) << "storing" << sessionId;
count++;
if (c->isActive())
active_client = 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", property);
+ qCWarning(KWIN_CORE, "caught attempt to sync non dynamic property: %s", property);
return;
}
QVariant v = c->property(property);
@@ -286,7 +286,7 @@ void TabGroup::blockStateUpdates(bool more) {
more ? ++m_stateUpdatesBlocked : --m_stateUpdatesBlocked;
if (m_stateUpdatesBlocked < 0) {
m_stateUpdatesBlocked = 0;
- qWarning("TabGroup: Something is messed up with TabGroup::blockStateUpdates() \
invocation\nReleased more than blocked!"); + qCWarning(KWIN_CORE, "TabGroup: Something \
is messed up with TabGroup::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::Libinput ${UDEV_LIBS})
+ target_link_libraries(libinputtest Qt5::Core Qt5::DBus Libinput::Libinput ${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 <QCoreApplication>
+#include <QLoggingCategory>
#include <linux/input.h>
#include <iostream>
+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 = window();
if (!qw) {
- qDebug() << "No QQuickWindow assigned yet";
+ qCDebug(KWIN_CORE) << "No QQuickWindow assigned yet";
return;
}
if (auto *w = static_cast<EffectWindowImpl*>(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("preferences-system-windows") << configModules(false); QString error;
if (KToolInvocation::kdeinitExec(QStringLiteral("kcmshell5"), args, &error) != \
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_ = Activities::self()->running();
- qDebug() << "activities:" << openActivities_.size();
+ qCDebug(KWIN_CORE) << "activities:" << openActivities_.size();
if (openActivities_.size() < 2) {
delete m_activityMenu;
m_activityMenu = 0;
@@ -1839,7 +1839,7 @@ void Workspace::slotInvertScreen()
continue;
}
if (gamma->size) {
- qDebug() << "inverting screen using XRRSetCrtcGamma";
+ qCDebug(KWIN_CORE) << "inverting screen using XRRSetCrtcGamma";
const int half = gamma->size / 2 + 1;
uint16_t *red = gamma.red();
@@ -1872,7 +1872,7 @@ void Workspace::slotInvertScreen()
green = new unsigned short[size];
blue = new unsigned short[size];
if (XF86VidModeGetGammaRamp(display(), scrn, size, red, green, blue)) {
- qDebug() << "inverting screen using XF86VidModeSetGammaRamp";
+ qCDebug(KWIN_CORE) << "inverting screen using XF86VidModeSetGammaRamp";
const int half = size / 2 + 1;
unsigned short swap;
for (int i = 0; i < half; ++i) {
@@ -1895,13 +1895,13 @@ void Workspace::slotInvertScreen()
//BEGIN effect plugin inversion - atm only works with OpenGL and has an overhead to it
if (effects) {
if (Effect *inverter = \
static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::ScreenInversion)) {
- qDebug() << "inverting screen using Effect plugin";
+ qCDebug(KWIN_CORE) << "inverting screen using Effect plugin";
QMetaObject::invokeMethod(inverter, "toggleScreenInversion", \
Qt::DirectConnection); }
}
if (!succeeded)
- qDebug() << "sorry - neither Xrandr, nor XF86VidModeSetGammaRamp worked and there's no \
inversion supplying effect plugin either"; + qCDebug(KWIN_CORE) << "sorry - neither \
Xrandr, nor XF86VidModeSetGammaRamp 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 <http://www.gnu.org/licenses/>.
#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 grabbed!";
}
keyboard_grabbed = 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 <http://www.gnu.org/licenses/>.
// KDE
#include <netwm_def.h>
// Qt
+#include <QLoggingCategory>
#include <QList>
#include <QPoint>
#include <QRect>
#include <QScopedPointer>
// system
#include <limits.h>
-
+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 <http://www.gnu.org/licenses/>.
#include "cursor.h"
#include "input.h"
#include "main.h"
+#include "utils.h"
#include <KWayland/Client/buffer.h>
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/connection_thread.h>
@@ -520,7 +521,7 @@ WaylandBackend::~WaylandBackend()
m_connectionThread->quit();
m_connectionThread->wait();
- qDebug() << "Destroyed Wayland display";
+ qCDebug(KWIN_CORE) << "Destroyed Wayland display";
s_self = 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 = options->borderlessMaximizedWindows();
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 <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "xcbutils.h"
+#include "utils.h"
// Qt
#include <QDebug>
// xcb
@@ -467,7 +468,7 @@ void Extensions::init()
if (m_sync.present) {
initVersion<xcb_sync_initialize_reply_t>(syncVersion, &xcb_sync_initialize_reply, \
&m_sync); }
- qDebug() << "Extensions: shape: 0x" << QString::number(m_shape.version, 16)
+ qCDebug(KWIN_CORE) << "Extensions: shape: 0x" << QString::number(m_shape.version, 16)
<< " composite: 0x" << QString::number(m_composite.version, 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 = xcb_get_extension_data(connection(), \
&xcb_shm_id); if (!ext || !ext->present) {
- qDebug() << "SHM extension not available";
+ qCDebug(KWIN_CORE) << "SHM extension not available";
return false;
}
ScopedCPointer<xcb_shm_query_version_reply_t> \
version(xcb_shm_query_version_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 information";
return false;
}
m_pixmapFormat = version->pixmap_format;
const int MAXSIZE = 4096 * 2048 * 4; // TODO check there are not larger windows
m_shmId = 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 = shmat(m_shmId, NULL, 0 /*read/write*/);
if (-1 == reinterpret_cast<long>(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 = xcb_shm_attach_checked(connection(), m_segment, m_shmId, \
false);
ScopedCPointer<xcb_generic_error_t> 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_code;
shmdt(m_buffer);
return false;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic