rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.88k stars 911 forks source link

`dpi`: add types for rectangles #3956

Open jgcodes2020 opened 1 month ago

jgcodes2020 commented 1 month ago

Description

This will be necessary for #3928/#403.

Wayland has the most restrictive design for positioning popups; so attributes for popup position will roughly follow Wayland's xdg_positioner. This requires rectangles.

While you could just use dpi::Position and dpi::Size, it's not nearly as idiomatic, and generally speaking, you want both position and size to be of the same type (physical/logical).

Relevant platforms

Windows, macOS, Wayland, X11, Web, iOS, Android

amrbashir commented 1 month ago

This would be a very nice addition IMO, currently for tauri, we have 3 different Rect in 3 different crates