diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-23 21:31:08 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-23 21:31:08 (GMT) |
commit | aab5e7248e2ac4015d9a771cd81e76de40083932 (patch) | |
tree | 5b172f4c825c8ffdec5a00204b24262f96be8a2c | |
parent | d5d68cc968cfeb0349723c6d43a0613753b476e9 (diff) | |
parent | 1c3ec3130a20b461eed9361fad3c67a8240e14d4 (diff) | |
download | tk-aab5e7248e2ac4015d9a771cd81e76de40083932.zip tk-aab5e7248e2ac4015d9a771cd81e76de40083932.tar.gz tk-aab5e7248e2ac4015d9a771cd81e76de40083932.tar.bz2 |
Fix [610aa08858]: Crash when collapsing toplevel vertically on X11. Thanks to Emiliano Gavilan and Donal Fellows.
Merge 8.6
-rw-r--r-- | generic/tkFont.c | 3 | ||||
-rw-r--r-- | generic/tkFrame.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 840d9b6..bb0b34f 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -1329,7 +1329,6 @@ Tk_GetFontFromObj( FreeFontObj(objPtr); fontPtr = NULL; } else if (Tk_Screen(tkwin) == fontPtr->screen) { - fontPtr->resourceRefCount++; return (Tk_Font) fontPtr; } } @@ -4307,7 +4306,7 @@ Tcl_Obj * TkDebugFont( Tk_Window tkwin, /* The window in which the font will be used * (not currently used). */ - const char *name) /* Name of the desired color. */ + const char *name) /* Name of the desired font. */ { TkFont *fontPtr; Tcl_HashEntry *hashPtr; diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 39ac164..1d93976 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -1526,10 +1526,14 @@ DisplayFrame( * off-screen memory, then copies it back on-screen in a single operation. * This means there's no point in time where the on-screen image has been * cleared. + * Also, ensure that the pixmap size is at least 1x1 pixels to prevent + * crashes, see [610aa08858]. */ pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin), - Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); + (Tk_Width(tkwin) > 0 ? Tk_Width(tkwin) : 1), + (Tk_Height(tkwin) > 0 ? Tk_Height(tkwin) : 1), + Tk_Depth(tkwin)); #else pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ |