summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2024-06-23 15:12:43 (GMT)
committerfvogel <fvogelnew1@free.fr>2024-06-23 15:12:43 (GMT)
commit6af02f49d75679a98b1ca939d9693ced5d567ac1 (patch)
tree1d44cc48d62cda48a621f3c614cadbe273356e45 /generic
parent0246d0f559b456595182156831a7a827a8a41c09 (diff)
downloadtk-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.c6
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 */