wails
wails copied to clipboard
Add screen position information to Screen / ScreenGetAll
Is your feature request related to a problem? Please describe.
Currently, runtime.ScreenGetAll() provides information about screen size but lacks screen position data, which is crucial for proper window positioning in multi-monitor setups. This makes it difficult to reliably position windows on specific monitors.
Describe the solution you'd like
Add position fields to the Screen struct.
The information to populate those is already available internally on supported platforms in `internal/frontend/desktop/*/screen.go:
- Windows: all info is readily available: inside
EnumProc(), seelprcMonitor - macOS: inside
GetNthScreen: you can get values fromNSScreen frame - Linux: inside
GetNThMonitor: usexandyfields inGdkRectangle geometry
Describe alternatives you've considered
No response
Additional context
Use Case:
When restoring window position in multi-monitor setups, we need to:
- Know where each screen is located in the virtual desktop space
- Validate if saved window coordinates are within valid screen bounds
- Ensure windows are restored to the correct monitor
- Handle cases where the previous monitor setup is no longer available