Skip to content
Discussion options

You must be logged in to vote

My question is how to specify the center position? Do I need to calculate the position manually?

Note that first of all, I think it's quite unusual for applications to position their window explicitly. It is generally better left to the window manager to choose a good starting location (which might take into account existing windows, current focus, mouse position, etc.). Exception might be when you're restoring the previous state of the application, or when the window is an alert that needs to be centered for attention.

But to answer the question, yes you need to calculate the position manually. This will require using some private API to access the winit window and then using that winit

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ultimaweapon
Comment options

@prof79
Comment options

Answer selected by ultimaweapon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants