diff options
author | dkf <dkf@noemail.net> | 2012-09-11 19:03:26 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2012-09-11 19:03:26 (GMT) |
commit | 6118e6e55c05d391aa338c59c6bfcb4d4822bbfc (patch) | |
tree | f110106ee285d4e6c08e38174d09e2aeabd0610a /generic/ttk | |
parent | 150ae9414739522377aeae9adc55d0c661576986 (diff) | |
parent | cbd752bac99c77684412fae9adbbd1412636f549 (diff) | |
download | tk-6118e6e55c05d391aa338c59c6bfcb4d4822bbfc.zip tk-6118e6e55c05d391aa338c59c6bfcb4d4822bbfc.tar.gz tk-6118e6e55c05d391aa338c59c6bfcb4d4822bbfc.tar.bz2 |
[Bug 3566594]: Fix clipping problem in classic X11; clip regions were leaking in
reused GCs.
FossilOrigin-Name: dda82bdcc182f221322b5e5ba21dd54fc4158e5d
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkEntry.c | 3 | ||||
-rw-r--r-- | generic/ttk/ttkLabel.c | 12 |
2 files changed, 9 insertions, 6 deletions
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( |