Is it possible to get the primary display size?

When I open a new window, it would be helpful to know what the current/primary display’s full size is, so that I can default to something sensible, i.e. not too big for screens with a low resolution, but also make the most of larger screen resolutions when available.

I can see how to get the size of the actual window element, but is it possible to get the size of the actual screen?

You can use Position::SpecificWith as the window::Settings::position to compute the window position based on the display resolution.

1 Like

For sizing, I’m afraid it’s not possible yet. But we could do something similar eventually.

However, keep in mind that all sizes and positions are logical in iced; this means they will be affected by OS scaling factors. Thus, sizes are decoupled from display resolution for the most part.