summaryrefslogtreecommitdiff
path: root/libdecoration/decoration.c
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2007-01-03 15:24:48 +0100
committerDavid Reveman <davidr@novell.com>2007-01-03 15:24:48 +0100
commit479ed6a2e0715e91a68b47450bfd7c904c36476e (patch)
treeeb9d98f28cbc8a2ecfb699dc0bf1c6cb4ee84aaf /libdecoration/decoration.c
parentb7a979b2b7cf1f94f8a96495409e94456f05be45 (diff)
Check version of libXrender and workaround gradient issue if older
than 0.9.3. See fdo bug 9526 for more info.
Diffstat (limited to 'libdecoration/decoration.c')
-rw-r--r--libdecoration/decoration.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libdecoration/decoration.c b/libdecoration/decoration.c
index 69b85e05..879eae7e 100644
--- a/libdecoration/decoration.c
+++ b/libdecoration/decoration.c
@@ -1826,6 +1826,41 @@ _decor_pad_border_picture (Display *xdisplay,
}
}
+#ifndef HAVE_XRENDER_0_9_3
+/* XRenderCreateLinearGradient and XRenderCreateRadialGradient used to be
+ * broken. Flushing Xlib's output buffer before calling one of these
+ * functions will avoid this specific issue.
+ */
+static Picture
+XRenderCreateLinearGradient_wrapper (Display *xdisplay,
+ const XLinearGradient *gradient,
+ const XFixed *stops,
+ const XRenderColor *colors,
+ int nStops)
+{
+ XFlush (xdisplay);
+
+ return XRenderCreateLinearGradient (xdisplay, gradient,
+ stops, colors, nStops);
+}
+
+static Picture
+XRenderCreateRadialGradient_wrapper (Display *xdisplay,
+ const XRadialGradient *gradient,
+ const XFixed *stops,
+ const XRenderColor *colors,
+ int nStops)
+{
+ XFlush (xdisplay);
+
+ return XRenderCreateRadialGradient (xdisplay, gradient,
+ stops, colors, nStops);
+}
+
+#define XRenderCreateLinearGradient XRenderCreateLinearGradient_wrapper
+#define XRenderCreateRadialGradient XRenderCreateRadialGradient_wrapper
+#endif
+
static void
_decor_blend_horz_border_picture (Display *xdisplay,
decor_context_t *context,