summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkEntry.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-06-12 08:29:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-06-12 08:29:27 (GMT)
commitfde697af64aae8450b540fb7eeb4f0f19aa3f005 (patch)
tree152cc41513346198a20a352370b2d8b0fe9dd1d0 /generic/ttk/ttkEntry.c
parent725e61cc4033c4fd2cccb831bac3c997fa61e712 (diff)
downloadtk-fde697af64aae8450b540fb7eeb4f0f19aa3f005.zip
tk-fde697af64aae8450b540fb7eeb4f0f19aa3f005.tar.gz
tk-fde697af64aae8450b540fb7eeb4f0f19aa3f005.tar.bz2
Fix text clipping when working with the Xft-based renderer.
Diffstat (limited to 'generic/ttk/ttkEntry.c')
-rw-r--r--generic/ttk/ttkEntry.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index e5d0ef2..a3d0179 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1221,7 +1221,8 @@ static void EntryDisplay(void *clientData, Drawable d)
}
}
- /* Initialize the clip region:
+ /* Initialize the clip region. Note that Xft does _not_ derive its
+ * clipping area from the GC, so we have to supply that by other means.
*/
rect.x = textarea.x;
@@ -1230,6 +1231,9 @@ static void EntryDisplay(void *clientData, Drawable d)
rect.height = textarea.height;
clipRegion = TkCreateRegion();
TkUnionRectWithRegion(&rect, clipRegion, clipRegion);
+#ifdef HAVE_XFT
+ TkUnixSetXftClipRegion(clipRegion);
+#endif
/* Draw cursor:
*/
@@ -1272,6 +1276,13 @@ static void EntryDisplay(void *clientData, Drawable d)
selFirst, selLast);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
+
+ /* Drop the region. Note that we have to manually remove the reference to
+ * it from the Xft guts (if they're being used).
+ */
+#ifdef HAVE_XFT
+ TkUnixSetXftClipRegion(None);
+#endif
TkDestroyRegion(clipRegion);
}