fix(window): correct pre-Tahoe traffic light size in fullscreen#330
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ptJBR correction flipped the aspect and turned the circles into pills.In
computeButtonMetrics(decorated-window-tao/.../NucleusTaoMetal.m):fminf(titleBarHeight * 0.5f, kMinHeightForFullSize * 0.5f)) — mirroringdecorated-window-jni.width * 14/12 - 2correction.14x16 ptaspect (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 viaFindClass+GetStaticMethodID. In release builds ProGuard renamed/stripped the bridge classes and their@JvmStaticcallbacks, so the lookups returned null and menu actions / delegate events were silently dropped (the exact failureNativeNsMenuBridgedocuments for #310).-keeprules forNativeNsMenuBridge(onMenuItemAction,onMenuWillOpen,onMenuDidClose,onMenuNeedsUpdate,onMenuWillHighlightItem,onNumberOfItemsInMenu) andNativeMacOsDockMenuBridge(onMenuItemClicked).launcher-macosso the dock-menu callback survives native-image too.media.control, notmediacontrol— the previous rule matched nothing.Tao backend only;
decorated-window-jnialready had the correct behavior.