diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp index 2dfe791e86..dc678b2339 100644 --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -362,6 +362,11 @@ void MouseClickEffect::drawCircleXr(const QColor& color, float cx, float cy, flo fill, effects->xrenderBufferPicture(), 0, 0, 0, strip.count(), strip.constData()); #undef DOUBLE_TO_FIXED +#else + Q_UNUSED(color) + Q_UNUSED(cx) + Q_UNUSED(cy) + Q_UNUSED(r) #endif } diff --git a/effects/screenedge/screenedgeeffect.cpp b/effects/screenedge/screenedgeeffect.cpp index b410cf1038..25f1d4a4b6 100644 --- a/effects/screenedge/screenedgeeffect.cpp +++ b/effects/screenedge/screenedgeeffect.cpp @@ -189,6 +189,10 @@ Glow *ScreenEdgeEffect::createGlow(ElectricBorder border, qreal factor, const QR if (!glow->texture.isNull()) { glow->texture->setWrapMode(GL_CLAMP_TO_EDGE); } + if (glow->texture.isNull()) { + delete glow; + return NULL; + } } else if (effects->compositingType() == XRenderCompositing) { #ifdef KWIN_HAVE_XRENDER_COMPOSITING if (border == ElectricTopLeft || border == ElectricTopRight || border == ElectricBottomRight || border == ElectricBottomLeft) { @@ -198,12 +202,12 @@ Glow *ScreenEdgeEffect::createGlow(ElectricBorder border, qreal factor, const QR glow->pictureSize = geometry.size(); glow->picture.reset(createEdgeGlow(border, geometry.size())); } + if (glow->picture.isNull()) { + delete glow; + return NULL; + } #endif } - if (glow->texture.isNull() && glow->picture.isNull()) { - delete glow; - return NULL; - } return glow; } diff --git a/effects/screenedge/screenedgeeffect.h b/effects/screenedge/screenedgeeffect.h index ccbacd103c..20e5ce1d73 100644 --- a/effects/screenedge/screenedgeeffect.h +++ b/effects/screenedge/screenedgeeffect.h @@ -58,10 +58,12 @@ class Glow { public: QScopedPointer texture; +#ifdef KWIN_HAVE_XRENDER_COMPOSITING QScopedPointer picture; + QSize pictureSize; +#endif qreal strength; QRect geometry; - QSize pictureSize; ElectricBorder border; }; diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index b830dca73e..59d3c475bc 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -64,7 +64,9 @@ ZoomEffect::ZoomEffect() , mousePointer(MousePointerScale) , focusDelay(350) // in milliseconds , texture(0) +#ifdef KWIN_HAVE_XRENDER_COMPOSITING , xrenderPicture(0) +#endif , imageWidth(0) , imageHeight(0) , isMouseHidden(false) @@ -140,8 +142,10 @@ void ZoomEffect::showCursor() XFixesShowCursor(display, DefaultRootWindow(display)); delete texture; texture = 0; +#ifdef KWIN_HAVE_XRENDER_COMPOSITING delete xrenderPicture; xrenderPicture = 0; +#endif isMouseHidden = false; } } @@ -153,9 +157,16 @@ void ZoomEffect::hideCursor() if (!isMouseHidden) { // try to load the cursor-theme into a OpenGL texture and if successful then hide the mouse-pointer recreateTexture(); - if (texture || xrenderPicture) { - Display* display = QX11Info::display(); - XFixesHideCursor(display, DefaultRootWindow(display)); + bool shouldHide = false; + if (effects->isOpenGLCompositing()) { + shouldHide = (texture != NULL); + } else if (effects->compositingType() == XRenderCompositing) { +#ifdef KWIN_HAVE_XRENDER_COMPOSITING + shouldHide = (xrenderPicture != NULL); +#endif + } + if (shouldHide) { + xcb_xfixes_hide_cursor(connection(), rootWindow()); isMouseHidden = true; } } diff --git a/effects/zoom/zoom.h b/effects/zoom/zoom.h index 1424c86779..76805d0193 100644 --- a/effects/zoom/zoom.h +++ b/effects/zoom/zoom.h @@ -117,7 +117,9 @@ private: QTime lastMouseEvent; QTime lastFocusEvent; GLTexture* texture; +#ifdef KWIN_HAVE_XRENDER_COMPOSITING XRenderPicture* xrenderPicture; +#endif int imageWidth; int imageHeight; bool isMouseHidden;