tauri_runtime/monitor.rs
1// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
2// SPDX-License-Identifier: Apache-2.0
3// SPDX-License-Identifier: MIT
4
5use crate::dpi::{PhysicalPosition, PhysicalSize};
6
7/// Monitor descriptor.
8#[derive(Debug, Clone)]
9pub struct Monitor {
10 /// A human-readable name of the monitor.
11 /// `None` if the monitor doesn't exist anymore.
12 pub name: Option<String>,
13 /// The monitor's resolution.
14 pub size: PhysicalSize<u32>,
15 /// The top-left corner position of the monitor relative to the larger full screen area.
16 pub position: PhysicalPosition<i32>,
17 /// Returns the scale factor that can be used to map logical pixels to physical pixels, and vice versa.
18 pub scale_factor: f64,
19}