-
-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Labels
platform: Windowsstatus: needs triageThis issue or pull request needs to be investigatedThis issue or pull request needs to be investigatedtype: bug
Description
tao/src/platform_impl/windows/monitor.rs
Lines 181 to 191 in dae6d88
| pub fn name(&self) -> Option<String> { | |
| let monitor_info = get_monitor_info(self.hmonitor()).unwrap(); | |
| Some(util::wchar_ptr_to_string(PCWSTR::from_raw( | |
| monitor_info.szDevice.as_ptr(), | |
| ))) | |
| } | |
| #[inline] | |
| pub fn native_identifier(&self) -> String { | |
| self.name().unwrap() | |
| } |
It is incorrect to directly use the Monitor Name as the Monitor ID. This ID cannot be used when managing the monitor. For example, the current method returns an ID like "\\\\.\\DISPLAY1", but the actual ID for the first monitor should be \\\\?\\DISPLAY#RTD0004#5&5bd6e4c&0&UID261#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}. This ID needs to be obtained through a more complex method.
I'm working on a project to set wallpapers for monitors. The wallpaper can only be successfully configured with the correct monitor ID, and the interface used to set the wallpaper is IDesktopWallpaper::SetWallpaper.
Metadata
Metadata
Assignees
Labels
platform: Windowsstatus: needs triageThis issue or pull request needs to be investigatedThis issue or pull request needs to be investigatedtype: bug