Skip to content

feat: add WindowChrome interface for frameless window support#13

Merged
kolkov merged 2 commits intomainfrom
feat/window-chrome
Mar 20, 2026
Merged

feat: add WindowChrome interface for frameless window support#13
kolkov merged 2 commits intomainfrom
feat/window-chrome

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Mar 20, 2026

Summary

Add WindowChrome interface for custom window chrome (frameless windows) support.

  • WindowChrome interface: SetFrameless, IsFrameless, SetHitTestCallback, Minimize, Maximize, IsMaximized, Close
  • HitTestResult enum (13 values): Client, Caption, Close, Maximize, Minimize, 8 resize edges/corners
  • HitTestCallback type: func(x, y float64) HitTestResult
  • NullWindowChrome: no-op implementation for testing
  • Updated doc.go, README.md, CHANGELOG.md

Enables replacing OS window chrome with GPU-rendered custom title bars. The application provides hit-test regions via callback so the OS can handle dragging, resizing, and window button interactions.

Implemented by gogpu.App (separate PR). Used by ui TitleBar widget.

Test plan

  • TestNullWindowChrome_Defaults — nil-safety
  • TestNullWindowChrome_Actions — no panics on all methods
  • TestHitTestResult_String — all 13 values
  • TestHitTestResult_Values — sequential constants
  • TestWindowChrome_CustomImplementation — frameless toggle, hit test callback, minimize, maximize toggle, close
  • go test ./... passes
  • golangci-lint run — 0 issues

kolkov added 2 commits March 19, 2026 13:58
Add WindowChrome interface with HitTestResult enum (13 values),
HitTestCallback type, and NullWindowChrome for testing.
Enables custom window chrome with drag, resize, and button regions.
Add WindowChrome interface, HitTestResult enum, HitTestCallback,
NullWindowChrome to CHANGELOG. Add WindowChrome to README features
and usage section with frameless window example.
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit c29b675 into main Mar 20, 2026
10 checks passed
@kolkov kolkov deleted the feat/window-chrome branch March 20, 2026 08:39
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