Files
image-workbench-desktop/src-tauri/Cargo.toml
T
qiqi 42435a0d39 fix(canvas-webview): 子 webview 的 hide/show 静默失效,改用移出窗口替代隐藏
现象:画布内网页节点建得起来,但画布一动网页就永久消失,用户看到一直是一块空白。

根因(最小 Tauri 工程实测):macOS 上对 Window::add_child 创建的子 webview
调 hide() 之后再 show(),两个调用都返回 Ok,网页却再也不出现。而位置同步引擎
在每次快速平移/缩放/拖动时都会先隐藏,所以拖一次画布就再也回不来。

- bounds 改为把视图挪到窗口外(-20000,-20000)代替 hide:NSView 在父视图外
  不绘制也不接收事件,效果等价,且移回原位有效(同一工程验证)
- ensure 失败回滚 open 并 1.5s 重试;bounds 返回找不到 webview 时同样回滚重建
  (原实现先置 open=true 再请求,一次失败就永久卡在「已创建」)
- 新增 _cwv.log 诊断日志 + page:started/finished 事件;创建失败/加载超时才
  把原因写进节点,不再让用户面对无法解释的空白
- 模态遮罩只认真正可见的(尺寸>=8x8),避免常驻 display:none 的遮罩让网页永不显示

版本 3.25.25
2026-11-18 23:55:21 +08:00

40 lines
1.3 KiB
TOML

[package]
name = "image-workbench"
version = "3.25.25"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
repository = ""
edition = "2024"
rust-version = "1.90"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "image_workbench_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.7.4", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
# tray-icon:系统托盘(关闭窗口收进托盘而不是退出)
# tray-icon:系统托盘;image-png:托盘用单色 PNG 模板图标
# unstable:只有它才导出 Window::add_child(画布内嵌子 webview 的唯一入口)。
# 该 API 在 tauri 2.x 里一直存在但被 cfg 门控,本项目只用到 add_child 一项。
tauri = { version = "2.12.5", features = ["tray-icon", "image-png", "unstable"] }
url = "2"
tauri-plugin-log = "2"
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-http = "2"
tauri-plugin-updater = "2"
tauri-plugin-single-instance = "2"
tauri-plugin-notification = "2"
arboard = "3"
image = { version = "0.25", default-features = false, features = ["png"] }
base64 = "0.22"