Expand description
§window-getter-rs
This is a Rust library for retrieving information about the windows open on the OS. Currently, it only supports macOS and Windows.
§Examples
fn main() {
let windows = window_getter::get_windows().unwrap();
for window in windows {
if let Ok(Some(title)) = window.title() {
println!("{title}");
}
}
}
§Platform supports
- macOS
- Windows
- Linux?
I have no plans to make Linux support at this time due to my inexperienced knowledge about Linux. But I’d be happy to receive pull requests.
§macOS permission
On macOS, you should need the permission of screen capture. Otherwise, you can’t get some window informations.
You can request the screen capture permission in runtime via this crate. Example is here. In development, you can also enable screen capture permission for the apps used to run the project (such as terminal or editors).
§License
This project is licensed under the MIT License.
Modules§
- platform_
impl - Platform-specific implementations for window.
Structs§
- Bounds
- Represents the bounds of a window. It can be converted from platform-specific bounds types.
- Window
- A wrapper around a platform-specific window. This struct provides a cross-platform interface to interact with window properties.
- Window
Id - A unique identifier for a window. It is used to track windows across different platforms.
Enums§
- Error
- Error types for window-getter-rs.
Functions§
- get_
window - Retrieves a window by its unique identifier.
- get_
windows - Retrieves a list of all open windows on the system.