From 7aa46a49a80c4e090566fb9244f8809a290c4dc9 Mon Sep 17 00:00:00 2001 From: treectrl Date: Thu, 7 Jul 2005 03:18:57 +0000 Subject: UnsetClipMask works around Tk_DrawChars not clearing the clip region on Win32. --- generic/tkTreeUtils.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c index e2c9ce0..fe539a5 100644 --- a/generic/tkTreeUtils.c +++ b/generic/tkTreeUtils.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2005 Tim Baker * - * RCS: @(#) $Id: tkTreeUtils.c,v 1.29 2005/06/18 01:52:38 treectrl Exp $ + * RCS: @(#) $Id: tkTreeUtils.c,v 1.30 2005/07/07 03:18:57 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -613,6 +613,22 @@ int Tree_ScrollWindow(TreeCtrl *tree, GC gc, int x, int y, return result; } +void UnsetClipMask(TreeCtrl *tree, Drawable drawable, GC gc) +{ + XSetClipMask(tree->display, gc, None); +#ifdef WIN32 + /* Tk_DrawChars does not clear the clip region */ + if (drawable == Tk_WindowId(tree->tkwin)) { + HDC dc; + TkWinDCState dcState; + + dc = TkWinGetDrawableDC(tree->display, drawable, &dcState); + SelectClipRgn(dc, NULL); + TkWinReleaseDrawableDC(drawable, dc, &dcState); + } +#endif +} + void Tree_DrawBitmapWithGC(TreeCtrl *tree, Pixmap bitmap, Drawable drawable, GC gc, int src_x, int src_y, int width, int height, int dest_x, int dest_y) { -- cgit v0.12