summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-09-12 11:52:57 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-09-12 11:52:57 (GMT)
commitc73a23b331cd44ccf3b38da59c901da5401b9ef5 (patch)
treeac3d15e34e73b8293ac0ce7cf05a13056e7cf902
parent16321d208e7b5eca41183b9f80ea2c122bf54219 (diff)
parent2a4e805e5ff66ad774106894fb21e014a8124794 (diff)
downloadtk-c73a23b331cd44ccf3b38da59c901da5401b9ef5.zip
tk-c73a23b331cd44ccf3b38da59c901da5401b9ef5.tar.gz
tk-c73a23b331cd44ccf3b38da59c901da5401b9ef5.tar.bz2
merge trunk
-rw-r--r--ChangeLog8
-rw-r--r--changes2
-rw-r--r--generic/ttk/ttkEntry.c3
-rw-r--r--generic/ttk/ttkLabel.c12
4 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index aa1f2ff..de8b350 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-09-11 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/ttk/ttkEntry.c (EntryDisplay): [Bug 3566594]: Must manually
+ * generic/ttk/ttkLabel.c (TextDraw): reset the clip region of GCs
+ when not using the Xft font renderer (well, especially on classic X11)
+ because the GC sharing code doesn't take into account clip handling.
+ Thanks to Christian Nassau for identifying the problem.
+
2012-09-07 Donal K. Fellows <dkf@users.sf.net>
* generic/tkCanvPs.c (TkCanvPostscriptCmd): [Bug 3565533]: Purge use
diff --git a/changes b/changes
index 2bda50d..a01ceae 100644
--- a/changes
+++ b/changes
@@ -7006,6 +7006,8 @@ and -to (porter)
2012-08-25 (bug fix)[3554026,3561016] crash with tearoff menus (gavilan)
+2012-09-11 (bug fix)[3566594] stop clip region leaks (fellows)
+
Many revisions to better support a Cygwin environment (nijtmans)
--- Released 8.6b3, September 7, 2012 --- See ChangeLog for details ---
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 136d4af..5ef7f81 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1254,6 +1254,7 @@ static void EntryDisplay(void *clientData, Drawable d)
gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion);
XFillRectangle(Tk_Display(tkwin), d, gc,
cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight);
+ TkSetRegion(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
@@ -1264,6 +1265,7 @@ static void EntryDisplay(void *clientData, Drawable d)
Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout,
entryPtr->entry.layoutX, entryPtr->entry.layoutY,
leftIndex, rightIndex);
+ TkSetRegion(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
/* Overwrite the selected portion (if any) in the -selectforeground color:
@@ -1274,6 +1276,7 @@ static void EntryDisplay(void *clientData, Drawable d)
Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout,
entryPtr->entry.layoutX, entryPtr->entry.layoutY,
selFirst, selLast);
+ TkSetRegion(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 5102baf..0f554a6 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -161,8 +161,6 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b)
TkSetRegion(Tk_Display(tkwin), gc2, clipRegion);
#ifdef HAVE_XFT
TkUnixSetXftClipRegion(clipRegion);
-#else
- TkDestroyRegion(clipRegion);
#endif
}
@@ -183,14 +181,16 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b)
text->textLayout, b.x, b.y, underline);
}
- Tk_FreeGC(Tk_Display(tkwin), gc1);
- Tk_FreeGC(Tk_Display(tkwin), gc2);
-#ifdef HAVE_XFT
if (clipRegion != NULL) {
+#ifdef HAVE_XFT
TkUnixSetXftClipRegion(None);
+#endif
+ TkSetRegion(Tk_Display(tkwin), gc1, None);
+ TkSetRegion(Tk_Display(tkwin), gc2, None);
TkDestroyRegion(clipRegion);
}
-#endif
+ Tk_FreeGC(Tk_Display(tkwin), gc1);
+ Tk_FreeGC(Tk_Display(tkwin), gc2);
}
static void TextElementSize(