summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-01-30 16:40:59 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-01-30 16:40:59 +0000
commit1378322fe43ee15ab4c581a1aa2ee5c69dcfe9cd (patch)
tree0efd0e063d564b12b0f8386772c29a2cb5e61cda /gdk
parent073a417988b26f7b74e721529aa76593998745f2 (diff)
downloadgtk+-1378322fe43ee15ab4c581a1aa2ee5c69dcfe9cd.tar.gz
Revert changes from #113476 and go back to using XftDrawSetClip, because
Fri Jan 30 11:37:37 2004 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkdrawable-x11.c: Revert changes from #113476 and go back to using XftDrawSetClip, because XftDrawSetClipRectangles is buggy in XFree86-4.3.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdrawable-x11.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 070e5efca9..3dbd8c1fa2 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -352,6 +352,7 @@ gdk_x11_drawable_update_xft_clip (GdkDrawable *drawable,
{
GdkRegionBox *boxes = gc_private->clip_region->rects;
gint n_boxes = gc_private->clip_region->numRects;
+#if 0 /* Until XftDrawSetClipRectangles is there */
XRectangle *rects = g_new (XRectangle, n_boxes);
int i;
@@ -365,6 +366,25 @@ gdk_x11_drawable_update_xft_clip (GdkDrawable *drawable,
XftDrawSetClipRectangles (xft_draw, 0, 0, rects, n_boxes);
g_free (rects);
+#else
+ Region xregion = XCreateRegion ();
+ int i;
+
+ for (i=0; i < n_boxes; i++)
+ {
+ XRectangle rect;
+
+ rect.x = CLAMP (boxes[i].x1 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT);
+ rect.y = CLAMP (boxes[i].y1 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT);
+ rect.width = CLAMP (boxes[i].x2 + gc->clip_x_origin, G_MINSHORT, G_MAXSHORT) - rect.x;
+ rect.height = CLAMP (boxes[i].y2 + gc->clip_y_origin, G_MINSHORT, G_MAXSHORT) - rect.y;
+
+ XUnionRectWithRegion (&rect, xregion, xregion);
+ }
+
+ XftDrawSetClip (xft_draw, xregion);
+ XDestroyRegion (xregion);
+#endif
}
else
{