summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-09-14 15:03:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-09-14 15:03:36 (GMT)
commita8512fc0800ca93149c86ad526313794ea16be36 (patch)
treebf5c160a96385cbbfa85adeb08dea3460d3ba323
parent970db01541fa840ec5e11fa8178a154ee94d5d9f (diff)
parente829dc68c26b7b313b94f777def7bb49c471422b (diff)
downloadtk-a8512fc0800ca93149c86ad526313794ea16be36.zip
tk-a8512fc0800ca93149c86ad526313794ea16be36.tar.gz
tk-a8512fc0800ca93149c86ad526313794ea16be36.tar.bz2
merge trunk
-rw-r--r--ChangeLog9
-rw-r--r--generic/ttk/ttkEntry.c10
-rw-r--r--generic/ttk/ttkLabel.c4
-rw-r--r--xlib/xgc.c2
4 files changed, 18 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 39b53bc..c34b77a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2012-09-13 Donal K. Fellows <dkf@users.sf.net>
+ * generic/ttk/ttkEntry.c (EntryDisplay): [Bug 3567453]: Clip regions
+ * generic/ttk/ttkLabel.c (TextDraw): must be cleared with XSetClipMask
+ * xlib/xgc.c (TkSetRegion): and not TkSetRegion, or crashes will ensue
+ on X11-based builds, which can't handle None for a region argument.
+ Added a clean panic to the non-X11 TkSetRegion to catch this case and
+ stop such confusion from happening again.
+
+2012-09-13 Donal K. Fellows <dkf@users.sf.net>
+
* win/tkWinWm.c (WmTransientCmd): [Bug 3567283]: Added missing cast.
2012-09-11 Donal K. Fellows <dkf@users.sf.net>
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 5ef7f81..a962662 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1151,7 +1151,9 @@ static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj, TkRegion clip)
mask |= GCForeground;
}
gc = Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues);
- TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip);
+ if (clip != None) {
+ TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip);
+ }
return gc;
}
@@ -1254,7 +1256,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);
+ XSetClipMask(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
@@ -1265,7 +1267,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);
+ XSetClipMask(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
/* Overwrite the selected portion (if any) in the -selectforeground color:
@@ -1276,7 +1278,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);
+ XSetClipMask(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index 0f554a6..0f71970 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -185,8 +185,8 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b)
#ifdef HAVE_XFT
TkUnixSetXftClipRegion(None);
#endif
- TkSetRegion(Tk_Display(tkwin), gc1, None);
- TkSetRegion(Tk_Display(tkwin), gc2, None);
+ XSetClipMask(Tk_Display(tkwin), gc1, None);
+ XSetClipMask(Tk_Display(tkwin), gc2, None);
TkDestroyRegion(clipRegion);
}
Tk_FreeGC(Tk_Display(tkwin), gc1);
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 0cebbc8..c6836bd 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -465,7 +465,7 @@ TkSetRegion(
TkRegion r)
{
if (r == None) {
- FreeClipMask(gc);
+ Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead");
} else {
TkpClipMask *clip_mask = AllocClipMask(gc);