Skip to content

fix(windows): give wmSetTitle its own message number - #17

Merged
xiaoyumuxi merged 1 commit into
mainfrom
fix/windows-set-title-message
Nov 14, 2026
Merged

xiaoyumuxi merged 1 commit into
mainfrom
fix/windows-set-title-message

Conversation

@xiaoyumuxi

Copy link
Copy Markdown

What this changes

wmSetTitle in internal/platform/windows/title_windows.go moves from 0x8052 to 0x8053, the next number that no private window message uses. The comment beside it now says why the number must differ from wmSetSize.

Why

main does not compile for Windows since #16. Upstream added wmSetSize = 0x8052 (internal/platform/windows/window_windows.go:66), and the fork's Window.SetTitle (#1) had already taken 0x8052 for wmSetTitle. #16 merged both without a text conflict, so the window procedure's switch kind now has two cases with the same value:

internal/platform/windows/window_windows.go:457:7: duplicate case wmSetTitle (constant 32850 of type uintptr) in expression switch
	internal/platform/windows/window_windows.go:451:7: previous case

The checks on #16 showed it: cross-vet, native (windows-latest), windows-arm64-text and windows-materials failed. Lithe-IDEA's desktop client pins main (609dd47) through replace for delta updates, so its Windows build fails the same way.

Upstream has no wmSetTitle (#1 was not sent upstream), so this fix has no upstream counterpart.

The private messages the Windows package uses after this change: 0x8001–0x8007 (32769–32775), 0x8010–0x8012, 0x8016–0x8017 (32790–32791), 0x8040, 0x8050, 0x8051, 0x8052 (wmSetSize), 0x8053 (wmSetTitle).

How it was verified

  • test -z "$(gofmt -l $(git ls-files '*.go'))": no files listed
  • go vet ./... on macOS (darwin/arm64): passes
  • go test ./... -count=1: not run locally. The change is in a windows-only file, which darwin tests do not build; this PR's Windows jobs run it.
  • platform vet: GOOS=windows GOARCH=amd64|arm64 CGO_ENABLED=0 go vet ./internal/platform/windows/ ./app/... ./headless/... ./update/... and go build ./... pass for both architectures. On 609dd47 without the change, the same build fails with the duplicate case above.
  • [N/A] benchmarks: no paint, layout or input path changed
  • [N/A] binary size: what links is unchanged
  • a real window: not run; no Windows machine here. Setting a title after the window opens is the path to try on Windows.

Where the boundary sits

A framework fix: the message numbers are internal to the Windows backend.

Cost

Nothing.

After merging

Lithe-IDEA bumps replace github.com/vivaui/viva => github.com/Lithe-IDEA/viva in desktop/go.mod to the commit this PR lands as on main.

Not part of this fix: size, web and windows-materials fail on upstream main too (b63e4a0 and 5b177b7), so they stay red here:

  • size: hello darwin/arm64 is 4172546 bytes, over the 3840000-byte limit.
  • web: TestApplyPatchChecksNameAndVersions fails on js with update: invalid feed: os "js" has no patch support.

Upstream's wmSetSize and the fork's wmSetTitle (#1) both took 0x8052, so the
window procedure's switch has a duplicate case once both are on main (#16) and
the Windows platform package does not compile. wmSetTitle moves to 0x8053, the
next number no private message uses.
@xiaoyumuxi
xiaoyumuxi merged commit 346b627 into main Nov 14, 2026
18 of 22 checks passed
xiaoyumuxi added a commit to 1lck/Lithe-IDEA that referenced this pull request Nov 14, 2026
desktop/go.mod 的 replace 从 fork main 609dd47 升到 4829f2b,
多出两项补丁:

- Lithe-IDEA/Lithe-viva#17:wmSetTitle 改用 0x8053,修复 #16 合入上游
  后与 wmSetSize 撞号导致的 Windows 编译失败。补的是 fork 独有的
  Window.SetTitle,上游没有对应 PR。
- Lithe-IDEA/Lithe-viva#18:新增 app.OpenPathInBrowser,上游 PR 为
  vivaui/viva#272。

require 仍是上游基线 b63e4a0,没有变化。

功能矩阵 embedded-viewers:Viva 的“在浏览器中打开”写明交给默认网页
浏览器、不跟随 .html 的文件关联,并注明 Windows 需实机确认;证据补上
browser_preview.go 及其测试,自动回归的 -run 加上 OpenInBrowser。
xiaoyumuxi added a commit to 1lck/Lithe-IDEA that referenced this pull request Nov 14, 2026
* wip(desktop): 在浏览器中打开 HTML 的回归测试(待 Viva 默认浏览器 API)

* fix(desktop): 在浏览器中打开 HTML 改为交给默认浏览器

预览栏的“在浏览器中打开”原来拼出 file:// 地址交给 app.OpenURL,
Viva 只接受 http、https、mailto,于是总是报错。改为调用 Viva 新增的
app.OpenPathInBrowser:交给默认浏览器(打开 http 链接的应用),
不跟随 .html 的文件关联,与旧客户端一致。

- 在后台调用,macOS 上要等 open 报告结果,不阻塞窗口线程。
- 失败时记录 app.operation_failed(operation=editor_open_in_browser),
  并在日志目录测试里登记。
- 回归测试断言文件交给了 LastOpenedInBrowser,既不是 OpenPath 也不是 OpenURL。

依赖 Lithe-IDEA/Lithe-viva#18(上游 vivaui/viva#272)合入 fork main
后升级 desktop/go.mod 的固定版本,在此之前本分支编译不过。

* fix(desktop): Viva 固定到含 OpenPathInBrowser 的 fork main

desktop/go.mod 的 replace 从 fork main 609dd47 升到 4829f2b,
多出两项补丁:

- Lithe-IDEA/Lithe-viva#17:wmSetTitle 改用 0x8053,修复 #16 合入上游
  后与 wmSetSize 撞号导致的 Windows 编译失败。补的是 fork 独有的
  Window.SetTitle,上游没有对应 PR。
- Lithe-IDEA/Lithe-viva#18:新增 app.OpenPathInBrowser,上游 PR 为
  vivaui/viva#272。

require 仍是上游基线 b63e4a0,没有变化。

功能矩阵 embedded-viewers:Viva 的“在浏览器中打开”写明交给默认网页
浏览器、不跟随 .html 的文件关联,并注明 Windows 需实机确认;证据补上
browser_preview.go 及其测试,自动回归的 -run 加上 OpenInBrowser。

* fix(desktop): 在浏览器中打开成功后才记录 app.action.performed

与设置页链接和修复前的行为一致:打开失败时只记录 app.operation_failed 和提示,不再同时记一条已执行的操作。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant