Compile on non-X11 systems...

svn path=/trunk/KDE/kdelibs/; revision=1214795
This commit is contained in:
Christian Ehrlicher 2011-01-16 12:20:20 +00:00
parent a6dc2ba624
commit 543168555b
2 changed files with 8 additions and 1 deletions

View File

@ -22,8 +22,9 @@
#include <kapplication.h> #include <kapplication.h>
#include <kdebug.h> #include <kdebug.h>
#ifdef Q_WS_X11
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif
namespace Plasma namespace Plasma
{ {
@ -34,12 +35,15 @@ EffectWatcher::EffectWatcher(Plasma::WindowEffects::Effect effect, QWidget *pare
m_effect(effect), m_effect(effect),
m_effectActive(false) m_effectActive(false)
{ {
#ifdef Q_WS_X11
kapp->installX11EventFilter( this ); kapp->installX11EventFilter( this );
Display *dpy = QX11Info::display(); Display *dpy = QX11Info::display();
XSelectInput(dpy, RootWindow(dpy, 0), PropertyChangeMask); XSelectInput(dpy, RootWindow(dpy, 0), PropertyChangeMask);
#endif
} }
#ifdef Q_WS_X11
bool EffectWatcher::x11Event(XEvent *event) bool EffectWatcher::x11Event(XEvent *event)
{ {
bool nowEffectActive = WindowEffects::isEffectAvailable(m_effect); bool nowEffectActive = WindowEffects::isEffectAvailable(m_effect);
@ -49,6 +53,7 @@ bool EffectWatcher::x11Event(XEvent *event)
} }
return QWidget::x11Event(event); return QWidget::x11Event(event);
} }
#endif
} }

View File

@ -35,7 +35,9 @@ public:
EffectWatcher(Plasma::WindowEffects::Effect effect, QWidget *parent = 0); EffectWatcher(Plasma::WindowEffects::Effect effect, QWidget *parent = 0);
protected: protected:
#ifdef Q_WS_X11
bool x11Event(XEvent *event); bool x11Event(XEvent *event);
#endif
Q_SIGNALS: Q_SIGNALS:
void blurBehindChanged(bool blur); void blurBehindChanged(bool blur);