summaryrefslogtreecommitdiffstats
path: root/generic/tkFrame.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-17 19:56:17 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-17 19:56:17 (GMT)
commit3b32c45a371ed2aae882f770c71a47e6e196a6dc (patch)
tree34f259df0149bdaad3aaa66fc3fc7e7e0a4d04c9 /generic/tkFrame.c
parent6ec6cf0d78478cb29891c5b96cbaabc605952fbb (diff)
parent63d4fcc37a6c1a0627064685179c8d4ec97a0217 (diff)
downloadtk-3b32c45a371ed2aae882f770c71a47e6e196a6dc.zip
tk-3b32c45a371ed2aae882f770c71a47e6e196a6dc.tar.gz
tk-3b32c45a371ed2aae882f770c71a47e6e196a6dc.tar.bz2
Fix [f9eddb541a]: Improve TkSetRegion(); implement XSetClipRectangles() on Windows and improve it. Thanks to Christopher Chavez.
Diffstat (limited to 'generic/tkFrame.c')
-rw-r--r--generic/tkFrame.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index fecf775..91ab80d 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -1480,7 +1480,7 @@ DisplayFrame(
Tk_Window tkwin = framePtr->tkwin;
int bdX1, bdY1, bdX2, bdY2, hlWidth;
Pixmap pixmap;
- TkRegion clipRegion = NULL;
+ Bool useClipping = False;
framePtr->flags &= ~REDRAW_PENDING;
if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
@@ -1619,11 +1619,9 @@ DisplayFrame(
if ((labelframePtr->labelBox.width < labelframePtr->labelReqWidth)
|| (labelframePtr->labelBox.height <
labelframePtr->labelReqHeight)) {
- clipRegion = TkCreateRegion();
- TkUnionRectWithRegion(&labelframePtr->labelBox, clipRegion,
- clipRegion);
- TkSetRegion(framePtr->display, labelframePtr->textGC,
- clipRegion);
+ useClipping = True;
+ XSetClipRectangles(framePtr->display, labelframePtr->textGC, 0, 0,
+ &labelframePtr->labelBox, 1, Unsorted);
}
Tk_DrawTextLayout(framePtr->display, pixmap,
@@ -1631,9 +1629,8 @@ DisplayFrame(
labelframePtr->labelTextX + LABELSPACING,
labelframePtr->labelTextY + LABELSPACING, 0, -1);
- if (clipRegion != NULL) {
+ if (useClipping) {
XSetClipMask(framePtr->display, labelframePtr->textGC, None);
- TkDestroyRegion(clipRegion);
}
} else {
/*