From kde-commits Thu Jan 20 09:41:11 2011 From: Marco Martin Date: Thu, 20 Jan 2011 09:41:11 +0000 To: kde-commits Subject: KDE/kdelibs/plasma/private Message-Id: <20110120094111.15CB0AC8B7 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129551651817510 SVN commit 1215920 by mart: check if the efect is active in the effectwatcher ctor, this avoids an useless themechanged signal, that among other things clears framesvg cache, forgetting the size of the other prefixes, that's why the pager was looking corrupted This problem asn't in branch since effectwatcher is only in trunk M +21 -9 effectwatcher.cpp M +1 -0 effectwatcher_p.h --- trunk/KDE/kdelibs/plasma/private/effectwatcher.cpp #1215919:1215920 @@ -32,9 +32,9 @@ EffectWatcher::EffectWatcher(QString property, QWidget *parent) : QWidget(parent), - m_property(property), - m_effectActive(false) + m_property(property) { + m_effectActive = isEffectActive(); #ifdef Q_WS_X11 kapp->installX11EventFilter( this ); Display *dpy = QX11Info::display(); @@ -55,13 +55,7 @@ Display *dpy = QX11Info::display(); Atom testAtom = XInternAtom(dpy, m_property.toLatin1(), False); if (event->xproperty.atom == testAtom) { - bool nowEffectActive = false; - int cnt; - Atom *list = XListProperties(dpy, DefaultRootWindow(dpy), &cnt); - if (list != NULL) { - nowEffectActive = (qFind(list, list + cnt, testAtom) != list + cnt); - XFree(list); - } + bool nowEffectActive = isEffectActive(); if (m_effectActive != nowEffectActive) { m_effectActive = nowEffectActive; emit blurBehindChanged(m_effectActive); @@ -72,7 +66,25 @@ } #endif +bool EffectWatcher::isEffectActive() const +{ +#ifdef Q_WS_X11 + Display *dpy = QX11Info::display(); + Atom testAtom = XInternAtom(dpy, m_property.toLatin1(), False); + bool nowEffectActive = false; + int cnt; + Atom *list = XListProperties(dpy, DefaultRootWindow(dpy), &cnt); + if (list != NULL) { + nowEffectActive = (qFind(list, list + cnt, testAtom) != list + cnt); + XFree(list); } + return nowEffectActive; +#else + return false; +#endif +} +} + #include "effectwatcher_p.moc" --- trunk/KDE/kdelibs/plasma/private/effectwatcher_p.h #1215919:1215920 @@ -35,6 +35,7 @@ EffectWatcher(QString property, QWidget *parent = 0); protected: + bool isEffectActive() const; #ifdef Q_WS_X11 bool x11Event(XEvent *event); #endif