在 Wayland 显示器 (CentOS) 上使用 tk_messageBox 时出现错误 'bad pad value "2m": must be positive screen distance'

Error 'bad pad value "2m": must be positive screen distance' when using tk_messageBox on a wayland display (CentOS)

我的 Tcl 脚本 运行 在 Ubuntu 上运行良好,但现在我已将一个脚本复制到 CentOS Linux 8 并出现上述错误。

即使我刚刚启动wish并输入tk_messageBox命令,也会出现错误。

安装的版本是tk.x86_64 1:8.6.8-1.el8

有什么办法可以解决这个错误吗?

在 Wayland 上,您必须手动设置 tk scaling。 我有这样的代码来设置默认值:

  # fedora 25 has a bug where 'Inf' is returned
  # but once set is ok...
  set tkscale [tk scaling]
  if { $tkscale eq "Inf" } {
    tk scaling -displayof . 1.3333
    set tkscale 1.3333
  }

我的评论不正确,应该说 Tcl returns "Inf" 当 屏幕尺寸为 0。

我找到了我打开的工单: https://core.tcl-lang.org/tk/tktview?name=2524085333