Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screen position information to Screen / ScreenGetAll #3947

Open
adnsv opened this issue Dec 13, 2024 · 2 comments
Open

Add screen position information to Screen / ScreenGetAll #3947

adnsv opened this issue Dec 13, 2024 · 2 comments
Labels
Enhancement New feature or request

Comments

@adnsv
Copy link

adnsv commented Dec 13, 2024

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(), see lprcMonitor
  • macOS: inside GetNthScreen: you can get values from NSScreen frame
  • Linux: inside GetNThMonitor: use x and y fields in GdkRectangle geometry

Describe alternatives you've considered

No response

Additional context

Use Case:

When restoring window position in multi-monitor setups, we need to:

  1. Know where each screen is located in the virtual desktop space
  2. Validate if saved window coordinates are within valid screen bounds
  3. Ensure windows are restored to the correct monitor
  4. Handle cases where the previous monitor setup is no longer available
@adnsv adnsv added the Enhancement New feature or request label Dec 13, 2024
@leaanthony
Copy link
Member

Thanks for opening this. Enhancements are now mainly considered for v3. To make sure that proposals are given proper consideration, we have created a process for proposing enhancements (this includes proposals to improve the enhancement proposal 😅) here: https://github.com/wailsapp/wails/blob/v3-alpha/v3/wep/README.md

Feel free to create a proposal and link to this ticket 👍

@c1ngular
Copy link

@adnsv you gonna also needs, onscreen change event and getScreenAll to correctly return info for whatever in your mind dealing with multiscreen, both I tried last time on V3, either absent or not working correctly .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants