macosui/macos_window_utils.dart

Make it possible to center the window on the screen

matthew-carroll opened this issue · 3 comments

Is there currently a set of APIs that makes it possible to set the size of the window and place it at the center of the screen?

If not, it would be great to have those APIs. I'm trying to control the initial launch of the app to center a window of a particular window size.

There currently is not, but implementing such functionality shouldn’t be too difficult.

Apparently, NSWindow has a center method which does exactly that, however, I’d argue that it’d be best to go all the way and offer methods to modify the window’s frame, thus allowing the window to be placed at arbitrary positions.

Excuse the delay. This feature is now impelemted.