pub struct MonitorInfo {
pub id: String,
pub name: String,
pub bounds: Rect,
pub work_area: Rect,
pub is_primary: bool,
pub scale_factor: f32,
}Expand description
A single connected display in the virtual-screen coordinate system.
Fields§
§id: StringStable-for-session identifier. On Windows this is the device
name reported by GetMonitorInfoW — for example \\.\DISPLAY1.
Stable across process runs on the same session; not
guaranteed to be stable across reboots or hardware changes.
name: StringHuman-readable display name (same as id on the current Windows
backend; kept as a distinct field so future backends can supply
a friendlier label).
bounds: RectFull monitor bounds in virtual-screen coordinates. May contain negative left/top when the monitor is arranged to the left of or above the primary monitor.
work_area: RectBounds excluding the taskbar and any other reserved-space widgets. This is what icons should honour when the user has a visible taskbar.
is_primary: boolTrue for the monitor that owns virtual coordinate (0, 0).
scale_factor: f32Effective DPI scale factor for this monitor, expressed as a
multiplier (1.0 = 96 DPI, 1.5 = 144 DPI, 2.0 = 192 DPI,
…).
This value is reported in the calling process’s coordinate space. A DPI-unaware process on a HiDPI monitor sees scale = 1.0 (Windows virtualises the coordinates so 96 DPI is always accurate for what the process draws); a per-monitor-DPI- aware process sees the true scale. Since icon coordinates use the same space, callers can multiply/divide safely without a second correction.
1.0 on backends that do not implement per-monitor DPI.