tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Window builder physical size/position

Open WilliamVenner opened this issue 2 years ago • 4 comments

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 :(

WilliamVenner avatar Sep 18 '22 20:09 WilliamVenner

Hi, I am working on this issue. I plan to add some config fields about size and position.

  1. physical_width: Option
  2. physical_height: Option
  3. physical_x: Option
  4. physical_y: Option And I will use these values to overide those corresponding config without physical if any of those values is not None.

ysinsane avatar Oct 02 '22 14:10 ysinsane

Hi, may I ask if you need the set position pixel unit and size unit seperately or you just want a total switch?

ysinsane avatar Oct 11 '22 02:10 ysinsane

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

WilliamVenner avatar Oct 11 '22 11:10 WilliamVenner

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

amrbashir avatar Oct 11 '22 11:10 amrbashir

Hi there, I'd like to help out with this issue. Is this issue being worked on by someone else?

tankh99 avatar Jul 06 '24 02:07 tankh99

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.

FabianLars avatar Jul 06 '24 08:07 FabianLars