Use #if HAVE_X11 instead of #ifdef HAVE_X11 as advised by David
This commit is contained in:
parent
6c29469338
commit
77b49e1a8a
@ -21,7 +21,7 @@
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
#include <QX11Info>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xlib.h>
|
||||
@ -125,7 +125,7 @@ void WindowShadows::Private::updateShadows()
|
||||
|
||||
void WindowShadows::Private::initPixmap(const QString &element)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
QPixmap pix = q->pixmap(element);
|
||||
if (pix.handle() == 0) {
|
||||
Pixmap xPix = XCreatePixmap(QX11Info::display(), QX11Info::appRootWindow(), pix.width(), pix.height(), 32);
|
||||
@ -153,7 +153,7 @@ void WindowShadows::Private::setupPixmaps()
|
||||
initPixmap("shadow-left");
|
||||
initPixmap("shadow-topleft");
|
||||
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
foreach (const QPixmap &pixmap, m_shadowPixmaps) {
|
||||
m_data << pixmap.handle();
|
||||
}
|
||||
@ -190,7 +190,7 @@ void WindowShadows::Private::setupPixmaps()
|
||||
|
||||
void WindowShadows::Private::clearPixmaps()
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
if (m_managePixmaps) {
|
||||
foreach (const QPixmap &pixmap, m_shadowPixmaps) {
|
||||
XFreePixmap(QX11Info::display(), pixmap.handle());
|
||||
@ -204,7 +204,7 @@ void WindowShadows::Private::clearPixmaps()
|
||||
|
||||
void WindowShadows::Private::updateShadow(const QWidget *window)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
if (m_data.isEmpty()) {
|
||||
setupPixmaps();
|
||||
}
|
||||
@ -220,7 +220,7 @@ void WindowShadows::Private::updateShadow(const QWidget *window)
|
||||
|
||||
void WindowShadows::Private::clearShadow(const QWidget *window)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
Display *dpy = QX11Info::display();
|
||||
Atom atom = XInternAtom(dpy, "_KDE_NET_WM_SHADOW", False);
|
||||
XDeleteProperty(dpy, window->winId(), atom);
|
||||
|
10
theme.cpp
10
theme.cpp
@ -29,7 +29,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
#include <QX11Info>
|
||||
#include "private/effectwatcher_p.h"
|
||||
#endif
|
||||
@ -113,7 +113,7 @@ public:
|
||||
|
||||
if (QPixmap::defaultDepth() > 8) {
|
||||
QObject::connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), q, SLOT(compositingChanged(bool)));
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
//watch for blur effect property changes as well
|
||||
if (!s_blurEffectWatcher) {
|
||||
s_blurEffectWatcher = new EffectWatcher("_KDE_NET_WM_BLUR_BEHIND_REGION");
|
||||
@ -170,7 +170,7 @@ public:
|
||||
static const char *defaultTheme;
|
||||
static const char *systemColorsTheme;
|
||||
static const char *themeRcFile;
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
static EffectWatcher *s_blurEffectWatcher;
|
||||
#endif
|
||||
|
||||
@ -215,7 +215,7 @@ const char *ThemePrivate::themeRcFile = "plasmarc";
|
||||
// the system colors theme is used to cache unthemed svgs with colorization needs
|
||||
// these svgs do not follow the theme's colors, but rather the system colors
|
||||
const char *ThemePrivate::systemColorsTheme = "internal-system-colors";
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
EffectWatcher *ThemePrivate::s_blurEffectWatcher = 0;
|
||||
#endif
|
||||
|
||||
@ -282,7 +282,7 @@ QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bo
|
||||
|
||||
void ThemePrivate::compositingChanged(bool active)
|
||||
{
|
||||
#ifdef HAVE_X11
|
||||
#if HAVE_X11
|
||||
if (compositingActive != active) {
|
||||
compositingActive = active;
|
||||
//kDebug() << QTime::currentTime();
|
||||
|
Loading…
Reference in New Issue
Block a user