tauri
tauri copied to clipboard
[feat] Window builder physical size/position
Describe the problem
There's no way to set the size and position of the window in the window builder to physical coordinates.
Describe the solution you'd like
The size and position methods should be able to accept either logical or physical units.
Alternatives considered
Setting the window size and position AFTER the window has been created, which for some reason accepts logical or physical coordinates despite the fact that the window builder doesn't? 🤔
Additional context
My use case is positioning a window on a specific monitor. This can only be done with physical units :(
Hi, I am working on this issue. I plan to add some config fields about size and position.
- physical_width: Option
- physical_height: Option
- physical_x: Option
- physical_y: Option
And I will use these values to overide those corresponding config without physical if any of those values is not None.
Hi, may I ask if you need the set position pixel unit and size unit seperately or you just want a total switch?
Ideally these functions should take tauri::Size
or tauri::Position
https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html#method.inner_size
https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html#method.min_inner_size
https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html#method.max_inner_size
https://docs.rs/tauri/latest/tauri/window/struct.WindowBuilder.html#method.position
Unfortunately that would be a breaking change... so I don't really know what would be best here
for now just add inner_size_physical
, min_inner_size_physical
...and so on, and we can change it in v2 to take either LogicalSize
or PhysicalSize
Hi there, I'd like to help out with this issue. Is this issue being worked on by someone else?
Not that we know off, but after the conversation here and in https://github.com/tauri-apps/tauri/pull/5381 i'm not sure what the wanted approach is.