[Feature] Support Creation of Windows at Specified Monitor#6043
[Feature] Support Creation of Windows at Specified Monitor#6043ndianabasi wants to merge 6 commits intofyne-io:masterfrom
Conversation
- This is implemented by providing a new method `showAtPos` which receives the `x` and `y` screen coordinates of for the window. - If the screen coordinates correspond to a point on a secondary screen/monitor, the underlying `glfw` implementation will show the window on the corresponding screen/monitor.
|
Thanks for this, but honestly I don't think the PR implements what the title describes. It has no concept of monitors and instead is implementing As you'll note our APIs are high level and describe intent and not the underlying detail - so "I want this to be on an external display" absolutely must be about requesting a secondary display not some X/Y position.
The user should not have to know anything about the OS X/Y coordinates to request a secondary monitor. That would mean platform specific code to make use of this API - making it kindof hard to use. The "more convenient" comment doesn't quite get us there - I think to support multiple monitor requests we really need to talk about monitors. I would propose an abstraction for requesting a specific monitor - such as |
andydotxyz
left a comment
There was a problem hiding this comment.
As noted in my longer comment - I don't think this is the right approach as it doesn't really implement what the title indicates.
| // Show the window on screen. | ||
| Show() | ||
| // Show the window on screen at a position. | ||
| // Since 2.7 |
There was a problem hiding this comment.
2.7 has already been released - 2.8 is next
| } | ||
|
|
||
| if !build.IsWayland && w.centered { | ||
| w.doCenterOnScreen() // lastly center if that was requested |
There was a problem hiding this comment.
My understanding is that "center on screen" and "show on external monitor" (this PR) conflict. We need to be describing monitors not x/y so that one does not override another.
There was a problem hiding this comment.
This commit addresses this concern. Request for "Center on screencallswindow.getMonitorForWindow. If w.xposandw.ypos` and set before the request for "center on screen", the correct monitor will be resolved and the window centered on the correct monitor.
|
Thank you for your review @andydotxyz. If I renamed the title of this PR to reflect that coordinates are needed, would it be accepted? Secondly, I am interested in implementing something like PS: I started experimenting with I love the framework and will love to invest in its improvements. Cheers! |
|
Maybe the title change didn't take? It If you want this to be about setting position then please read the linked issue - you will see all of the complexity. I am much more keen to support display requesting than the potentially-problematic position setting. Particularly because the use-case you describe is related to monitor and not positions. Let's expose the API based on use-case. |
Description:
This PR implements support for multiple monitors by allowing the user to specify the coordinate where the window should be rendered from.
showAtPoswhich receives thexandyscreen coordinate of for the window.glfwimplementation will show the window on the corresponding screen/monitor.Supported Improvements
This PR assumes the user has resolve the coordinate using any means. It will be more convenient if there is a method off the
apppackage which exposes all monitors from the underlying theglfwpackage. So that the user can pick the coordinate without iinstalling other 3rd-party packages.Fixes #2809 (comment)
Checklist:
Where applicable: