Skip to content

v0.6.0rc5

Pre-release
Pre-release

Choose a tag to compare

@xiaosuawa xiaosuawa released this 12 Jun 09:43
· 6 commits to master since this release

⚠️ Release Candidate — API may still change before the final v0.6.0.
⚠️ 候选版本 — API 在正式 v0.6.0 发布前仍可能调整。


🐛 Fixes / 修复

  • Windows resize black-edge flicker — Windows resize 黑边闪烁。 窗口缩放时 WebView 边缘出现短暂黑色闪烁。根因:DWM layered surface 扩展后新区域 alpha=0,且 createWindowContainer 阻止了 _AnchorWindow 的 paintEvent 触发。修复方案:_AnchorWindow 监听 WM_SIZE / WM_EXITSIZEMOVE,直接调用 Win32 UpdateLayeredWindow API 提交 per-pixel alpha=1 的 32-bit BGRA 背景层 bitmap,绕过 Qt 的 paint 系统。调用频率节流至 ~30fps 避免 DWM 重合成导致 WebView 内容闪烁。缓存 DIB section 避免每次 resize 重建 GDI 对象。

    The WebView showed a brief black flash at the edges during window resize. Root cause: the DWM layered surface defaults new areas to alpha=0, and createWindowContainer suppresses _AnchorWindow's paintEvent. Fix: _AnchorWindow listens for WM_SIZE / WM_EXITSIZEMOVE and calls Win32 UpdateLayeredWindow directly to submit a per-pixel alpha=1 32-bit BGRA background bitmap — bypassing Qt's paint machinery entirely. Calls are throttled to ~30 fps to prevent DWM re-composition flicker of the WebView content. The DIB section is cached to avoid GDI object churn.

🔧 Internal / 内部重构

  • 模块拆分 Module split。 widget.py(~960 行)拆为三个文件:_bridge.py(JS Bridge:Signals、DictJsBridge、JS 脚本)、_anchor.py(_AnchorWindow:Windows layered surface resize 修复)、widget.py(QtWebViewWidget:~660 行)。下划线前缀表示内部模块,不暴露给用户。

    widget.py (~960 lines) split into three modules: _bridge.py (JS Bridge: Signals, DictJsBridge, JS payloads), _anchor.py (_AnchorWindow: Windows layered surface resize fix), widget.py (QtWebViewWidget: ~660 lines). Underscore prefix denotes internal modules — not part of the public API.


Full Changelog: v0.6.0rc4...v0.6.0rc5