-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
EnhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
I have multiple windows in my app, and I would like to use macOSs default behaviour for positioning windows.
Describe the solution you'd like
Expose cascadeTopLeft(from:) so we can use it from window := app.Window.NewWithOptions(application.WebviewWindowOptions{}) or window.SetPosition() 🙏
Describe alternatives you've considered
This does the trick for now, setting the cascadeOffset to 32, seems to be about right for macOS Tahoe, but I suspect it's smaller for earlier versions of macOS.
// Apply cascade offset for subsequent windows
if windowCount > 0 {
// Get current position (first window will be centered by OS)
// Then offset based on window count
offset := windowCount * cascadeOffset
// Position relative to top-left, accounting for menubar
window.SetRelativePosition(100+offset, 100+offset)
}
windowCount++
Additional context
No response
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or requestNew feature or request