fix(darwin): preserve FloatingPanel level, clean up sendEvent

- Fix FloatingPanel level override: skip setting default WindowLevel
  when NSPanel has FloatingPanel=true, preserving setFloatingPanel
  behavior
- Clean up sendEvent override comments
- Fix typo in changelog (auxillary -> auxiliary)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
grantmartin2002-oss 2026-03-02 16:10:57 -06:00
commit 6bb5a5709b
3 changed files with 7 additions and 10 deletions

View file

@ -1425,10 +1425,13 @@ func (w *macosWebviewWindow) run() {
case MacBackdropNormal:
}
if macOptions.WindowLevel == "" {
macOptions.WindowLevel = MacWindowLevelNormal
// Only set window level if explicitly specified, or if not a floating panel
// (setFloatingPanel:YES already sets NSFloatingWindowLevel, so don't override it)
if macOptions.WindowLevel != "" {
w.setWindowLevel(macOptions.WindowLevel)
} else if !(macOptions.WindowClass == NSPanel && macOptions.PanelOptions.FloatingPanel) {
w.setWindowLevel(MacWindowLevelNormal)
}
w.setWindowLevel(macOptions.WindowLevel)
// Set collection behavior (defaults to FullScreenPrimary for backwards compatibility)
w.setCollectionBehavior(macOptions.CollectionBehavior)

View file

@ -32,10 +32,7 @@ typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) {
// This ensures KeyBindings work regardless of first responder state
- (void)sendEvent:(NSEvent *)event {
if (event.type == NSEventTypeKeyDown) {
// Process through keybinding system first
[self keyDown:event];
// Still pass to WKWebView for normal input handling
// (keybinding callbacks like Hide will take effect regardless)
}
[super sendEvent:event];
}
@ -269,10 +266,7 @@ typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) {
// This ensures KeyBindings work regardless of first responder state
- (void)sendEvent:(NSEvent *)event {
if (event.type == NSEventTypeKeyDown) {
// Process through keybinding system first
[self keyDown:event];
// Still pass to WKWebView for normal input handling
// (keybinding callbacks like Hide will take effect regardless)
}
[super sendEvent:event];
}

View file

@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added NSPanel support for macOS. Panels serve as auxillary windows and can appear over fullscreen apps without activating the application using `NSWindowStyleMaskNonactivatingPanel`. Configure via `Mac.WindowClass` and `Mac.PanelOptions` in window options. Added by [@Grantmartin2002](https://github.com/Grantmartin2002) in [PR](https://github.com/wailsapp/wails/pull/5024)
- Added NSPanel support for macOS. Panels serve as auxiliary windows and can appear over fullscreen apps without activating the application using `NSWindowStyleMaskNonactivatingPanel`. Configure via `Mac.WindowClass` and `Mac.PanelOptions` in window options. Added by [@Grantmartin2002](https://github.com/Grantmartin2002) in [PR](https://github.com/wailsapp/wails/pull/5024)
### Fixed
- Fixed locking issue on Windows when multiselect dialog returns an error. Fixed in [PR](https://github.com/wailsapp/wails/pull/4156) by @johannes-luebke