diff options
author | fvogel <fvogelnew1@free.fr> | 2024-06-23 15:12:43 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2024-06-23 15:12:43 (GMT) |
commit | 6af02f49d75679a98b1ca939d9693ced5d567ac1 (patch) | |
tree | 1d44cc48d62cda48a621f3c614cadbe273356e45 /generic | |
parent | 0246d0f559b456595182156831a7a827a8a41c09 (diff) | |
download | tk-6af02f49d75679a98b1ca939d9693ced5d567ac1.zip tk-6af02f49d75679a98b1ca939d9693ced5d567ac1.tar.gz tk-6af02f49d75679a98b1ca939d9693ced5d567ac1.tar.bz2 |
Fix [610aa08858]: Crash when collapsing toplevel vertically on X11. Thanks to Emiliano Gavilan and Donal Fellows.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkFrame.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 32f89f2..302542c 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -1468,10 +1468,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 */ |