diff options
author | culler <culler> | 2020-08-01 16:12:43 (GMT) |
---|---|---|
committer | culler <culler> | 2020-08-01 16:12:43 (GMT) |
commit | 0266964e830c47c5a6e12654b8e84378dfe97ca5 (patch) | |
tree | 7996b84cd6c83c18d322691f10b39910265b3adc /generic | |
parent | e6d961299e585273d99aa80444ad9237449c512a (diff) | |
download | tk-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')
-rw-r--r-- | generic/tkCmds.c | 16 |
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; } |