From e790284eee7a73e24c2d928078262af2db970964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 29 Jan 2013 08:28:30 +0100 Subject: [PATCH] Port SnapHelper effect to XCB --- effects/snaphelper/snaphelper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/effects/snaphelper/snaphelper.cpp b/effects/snaphelper/snaphelper.cpp index f2a286aa5a..2f7f0ff14d 100644 --- a/effects/snaphelper/snaphelper.cpp +++ b/effects/snaphelper/snaphelper.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #include "kwinglutils.h" #ifdef KWIN_HAVE_XRENDER_COMPOSITING #include "kwinxrenderutils.h" +#include #endif namespace KWin @@ -134,7 +135,7 @@ void SnapHelperEffect::postPaintScreen() int halfWidth = m_window->width() / 2; int halfHeight = m_window->height() / 2; - XRectangle rects[6]; + xcb_rectangle_t rects[6]; // Center lines rects[0].x = rect.x() + rect.width() / 2 - 2; rects[0].y = rect.y(); @@ -164,8 +165,9 @@ void SnapHelperEffect::postPaintScreen() rects[5].width = 4; rects[5].height = 2*halfHeight - 4; - XRenderColor c = preMultiply(QColor(128, 128, 128, m_timeline.currentValue()*128)); - XRenderFillRectangles(display(), PictOpOver, effects->xrenderBufferPicture(), &c, rects, 6); + XRenderColor xc = preMultiply(QColor(128, 128, 128, m_timeline.currentValue()*128)); + xcb_render_color_t c = {xc.red, xc.green, xc.blue, xc.alpha}; + xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_OVER, effects->xrenderBufferPicture(), c, 6, rects); } #endif }