Skip to content

fix(window): correct pre-Tahoe traffic light size in fullscreen#330

Merged
kdroidFilter merged 2 commits into
mainfrom
fix/310-pretahoe-traffic-lights-fullscreen
Jul 13, 2026
Merged

fix(window): correct pre-Tahoe traffic light size in fullscreen#330
kdroidFilter merged 2 commits into
mainfrom
fix/310-pretahoe-traffic-lights-fullscreen

Conversation

@kdroidFilter

@kdroidFilter kdroidFilter commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #310.

Two parts, both required to fully resolve #310 on the Tao backend.

1. Pre-Tahoe traffic light size in fullscreen

On pre-Tahoe macOS, the traffic-light (window control) buttons stretched horizontally when entering full screen. Windowed mode was round (Auto Layout's intrinsic width), but full screen forced a too-small frame: pinning the width to the native 14 pt combined with the -2 pt JBR correction flipped the aspect and turned the circles into pills.

In computeButtonMetrics (decorated-window-tao/.../NucleusTaoMetal.m):

  • Adapt the button width to the title-bar height, capped at the native 14 pt (fminf(titleBarHeight * 0.5f, kMinHeightForFullSize * 0.5f)) — mirroring decorated-window-jni.
  • Branch the height aspect by OS version:
    • Tahoe+: keep JBR's width * 14/12 - 2 correction.
    • pre-Tahoe: use the native 14x16 pt aspect (width * 16/14) so the glyphs aren't squashed.

2. ProGuard rules for macOS menu JNI callbacks

The native macOS menu bar (menu-macos) and dock menu (launcher-macos) bridges are looked up by name from ObjC via FindClass + GetStaticMethodID. In release builds ProGuard renamed/stripped the bridge classes and their @JvmStatic callbacks, so the lookups returned null and menu actions / delegate events were silently dropped (the exact failure NativeNsMenuBridge documents for #310).

  • Add -keep rules for NativeNsMenuBridge (onMenuItemAction, onMenuWillOpen, onMenuDidClose, onMenuNeedsUpdate, onMenuWillHighlightItem, onNumberOfItemsInMenu) and NativeMacOsDockMenuBridge (onMenuItemClicked).
  • Add the missing GraalVM reachability metadata for launcher-macos so the dock-menu callback survives native-image too.
  • Fix the media-control keep rule: package is media.control, not mediacontrol — the previous rule matched nothing.

Tao backend only; decorated-window-jni already had the correct behavior.

Traffic-light buttons stretched horizontally in fullscreen on pre-Tahoe
macOS. Adapt the button width to the title-bar height (capped at the
native 14 pt) and branch the height aspect: Tahoe keeps JBR's 14/12 - 2
correction, pre-Tahoe uses the native 14x16 pt aspect so the glyphs are
not squashed. Mirrors decorated-window-jni.
The native macOS menu bar (menu-macos) and dock menu (launcher-macos)
bridges are looked up by name from ObjC via FindClass + GetStaticMethodID.
ProGuard renamed/stripped the bridge classes and their @JvmStatic callbacks
in release builds, so the lookups returned null and menu actions/delegate
events were silently dropped.

- Add -keep rules for NativeNsMenuBridge (onMenuItemAction, onMenuWillOpen,
  onMenuDidClose, onMenuNeedsUpdate, onMenuWillHighlightItem,
  onNumberOfItemsInMenu) and NativeMacOsDockMenuBridge (onMenuItemClicked).
- Add the missing GraalVM reachability metadata for launcher-macos so the
  dock-menu callback survives native-image too.
- Fix media-control keep rule: package is media.control, not mediacontrol,
  so the previous rule matched nothing.
@kdroidFilter kdroidFilter merged commit 3b5612b into main Jul 13, 2026
12 checks passed
@kdroidFilter kdroidFilter deleted the fix/310-pretahoe-traffic-lights-fullscreen branch July 13, 2026 10:47
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.

Several bugs from decorated window title bar both in Jewel and Nucleus 2.0

1 participant