summaryrefslogtreecommitdiffstats
path: root/generic/tkCmds.c
diff options
context:
space:
mode:
authorculler <culler>2020-08-01 16:12:43 (GMT)
committerculler <culler>2020-08-01 16:12:43 (GMT)
commit0266964e830c47c5a6e12654b8e84378dfe97ca5 (patch)
tree7996b84cd6c83c18d322691f10b39910265b3adc /generic/tkCmds.c
parente6d961299e585273d99aa80444ad9237449c512a (diff)
downloadtk-0266964e830c47c5a6e12654b8e84378dfe97ca5.zip
tk-0266964e830c47c5a6e12654b8e84378dfe97ca5.tar.gz
tk-0266964e830c47c5a6e12654b8e84378dfe97ca5.tar.bz2
The colormaps do not fix winfo rgb. Handle that directly. And deal with Big Sur deprecations.
Diffstat (limited to 'generic/tkCmds.c')
-rw-r--r--generic/tkCmds.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index 7f4c49b..1bc4f8c 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -1748,7 +1748,23 @@ Tk_WinfoObjCmd(
if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin) != TCL_OK) {
return TCL_ERROR;
}
+#ifdef TK_HAS_DYNAMIC_COLORS
+
+ /*
+ * Make sure that the TkColor used for the winfo rgb command is
+ * destroyed when we are through with it, so we do not get stale RGB
+ * values next time.
+ */
+
+ {
+ Colormap temp = Tk_Colormap(tkwin);
+ Tk_Colormap(tkwin) = TK_DYNAMIC_COLORMAP;
+ colorPtr = Tk_GetColor(interp, tkwin, Tcl_GetString(objv[3]));
+ Tk_Colormap(tkwin) = temp;
+ }
+#else
colorPtr = Tk_GetColor(interp, tkwin, Tcl_GetString(objv[3]));
+#endif
if (colorPtr == NULL) {
return TCL_ERROR;
}