fix(v3/darwin): add effectiveZoomButtonState and fix runtime NSWindowZoomButton conflict#5455
fix(v3/darwin): add effectiveZoomButtonState and fix runtime NSWindowZoomButton conflict#5455taliesin-ai wants to merge 1 commit into
Conversation
…omButton conflict Both setMaximiseButtonState and setFullscreenButtonState now call effectiveZoomButtonState so the more restrictive of the two settings always wins at runtime (Hidden > Disabled > Enabled). The previous startup-only guard `if FullscreenButtonState != ButtonEnabled` was incorrect: it skipped setFullscreenButtonState when ButtonEnabled, so a runtime SetFullscreenButtonState(ButtonEnabled) call could silently un-grey a button that MaximiseButtonState had disabled. The setters now handle reconciliation, making a single setMaximiseButtonState call at startup sufficient. Adds TestEffectiveZoomButtonState: 13 subtests covering all ButtonState combinations plus commutativity verification. Closes wailsapp#5319
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughmacOS window button state handling is updated to reconcile fullscreen and maximise modes that both target NSWindowZoomButton. A new effective-state helper selects the more restrictive state; both button setters now compute and apply this effective state instead of raw states. Window initialization is refactored to delegate fullscreen reconciliation through ChangesButton State Reconciliation on macOS
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #5467 (merged 2026-05-16), which landed the same |
Summary
effectiveZoomButtonState(a, b ButtonState) ButtonStatehelper that returns the more restrictive of twoButtonStatevalues (Hidden > Disabled > Enabled)setMaximiseButtonStateandsetFullscreenButtonStatenow call this helper, so neither can silently override the other at runtime — the "more restrictive wins" contract holds regardless of call orderif options.FullscreenButtonState != ButtonEnabledinrun()— it was wrong (a runtimeSetFullscreenButtonState(ButtonEnabled)call could undo aMaximiseButtonState: ButtonDisabled) and is no longer needed since reconciliation is in the settersTestEffectiveZoomButtonStatewith 13 subtests covering allButtonStatecombinations plus commutativity checksBackground
MaximiseButtonStateandFullscreenButtonStateboth targetNSWindowZoomButton(the green traffic-light button). Inmaster, whichever setter runs last wins. This PR makes both setters always enforce the more restrictive of the two settings, both at startup and at runtime.Test results
Closes #5319
CC @leaanthony
Summary by CodeRabbit
Bug Fixes