From 0ff5568cff9912b71c0ed52016e2132f45c5291d Mon Sep 17 00:00:00 2001 From: grantmartin2002-oss Date: Thu, 5 Mar 2026 17:19:33 -0600 Subject: [PATCH] refactored comments and documentation --- .../content/docs/features/windows/options.mdx | 16 ++++++++-------- v3/pkg/application/webview_window_options.go | 8 ++++---- website/src/pages/changelog.mdx | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/src/content/docs/features/windows/options.mdx b/docs/src/content/docs/features/windows/options.mdx index 7cdb927d6..1f22d52f2 100644 --- a/docs/src/content/docs/features/windows/options.mdx +++ b/docs/src/content/docs/features/windows/options.mdx @@ -828,7 +828,7 @@ Controls how the window behaves across macOS Spaces and fullscreen. These are bi - `MacWindowCollectionBehaviorFullScreenAllowsTiling` - Allows side-by-side tiling (macOS 10.11+) - `MacWindowCollectionBehaviorFullScreenDisallowsTiling` - Prevents tiling (macOS 10.11+) -**Note:** NSWindow fullscreen overlay requires `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }` +**Note:** MacWindowClassWindow fullscreen overlay requires `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }` **Example - Spotlight-like window:** ```go @@ -850,24 +850,24 @@ Mac: application.MacWindow{ ``` **WindowClass** (`MacWindowClass`) -- `NSWindow` - Standard window (default) -- `NSPanel` - Auxiliary window that can float above other windows and receive input without activating the application +- `MacWindowClassWindow` - Standard window (default) +- `MacWindowClassPanel` - Auxiliary window that can float above other windows and receive input without activating the application -**PanelOptions** (`MacPanelOptions`) +**PanelPreferences** (`MacPanelPreferences`) -Options for NSPanel windows (only applies when `WindowClass` is `NSPanel`): +Preferences for MacWindowClassPanel windows (only applies when `WindowClass` is `MacWindowClassPanel`): - `FloatingPanel` - Panel floats above other windows - `BecomesKeyOnlyIfNeeded` - Panel becomes key only when needed - `NonactivatingPanel` - Panel receives input without activating the application - `UtilityWindow` - Panel uses utility window style -**Note:** Unlike NSWindow, NSPanel fullscreen overlay does NOT require `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }` +**Note:** Unlike MacWindowClassWindow, MacWindowClassPanel fullscreen overlay does NOT require `application.Options{ Mac: application.MacOptions{ ActivationPolicy: application.ActivationPolicyAccessory } }` **Example - Spotlight-like panel:** ```go Mac: application.MacWindow{ - WindowClass: application.NSPanel, - PanelOptions: application.MacPanelOptions{ + WindowClass: application.MacWindowClassPanel, + PanelPreferences: application.MacPanelPreferences{ NonactivatingPanel: true, }, CollectionBehavior: application.MacWindowCollectionBehaviorCanJoinAllSpaces | diff --git a/v3/pkg/application/webview_window_options.go b/v3/pkg/application/webview_window_options.go index ffbaec374..fdabae015 100644 --- a/v3/pkg/application/webview_window_options.go +++ b/v3/pkg/application/webview_window_options.go @@ -489,7 +489,7 @@ type MacWindow struct { // WindowClass is the window class for the window WindowClass MacWindowClass - // PanelOptions contains options for NSPanel windows + // PanelPreferences contains configuration for panel windows PanelPreferences MacPanelPreferences } @@ -497,13 +497,13 @@ type MacWindow struct { type MacWindowClass int const ( - // MacWindowClassWindow - The default value. The window will be a NSWindow, a window that an app displays on the screen. + // MacWindowClassWindow - The default value. A window that an app displays on the screen. MacWindowClassWindow MacWindowClass = iota - // MacWindowClassPanel - The window will be a NSPanel, a special kind of window that typically performs a function that is auxiliary to the main window + // MacWindowClassPanel - A special kind of window that typically performs a function that is auxiliary to the main window MacWindowClassPanel ) -// MacPanelOptions contains options for NSPanel windows +// MacPanelPreferences contains options for MacWindowClassPanel windows type MacPanelPreferences struct { // FloatingPanel will make the panel float above other windows FloatingPanel u.Bool diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index d65c85432..ac7e7804e 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -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 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) +- Added Panel 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.PanelPreferences` 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