Skip to content

Commit

Permalink
feat(wm): use monitor hardware ids where available
Browse files Browse the repository at this point in the history
This commit pulls in changes to win32-display-data which provide the
monitor hardware serial number id taken from WmiMonitorID where
available.

No work has yet been done to integrate this with options such as
display_index_preferences.
  • Loading branch information
LGUG2Z committed Jan 26, 2025
1 parent 81c143d commit e2f7fe5
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 12 deletions.
180 changes: 176 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
paste = "1"
sysinfo = "0.33"
uds_windows = "1"
win32-display-data = { git = "/~https://github.com/LGUG2Z/win32-display-data", rev = "dd65e3f22d0521b78fcddde11abc2a3e9dcc32a8" }
win32-display-data = { git = "/~https://github.com/LGUG2Z/win32-display-data", rev = "75286e77c068a89d12adcd6404c9c4874a60acf5" }
windows-implement = { version = "0.58" }
windows-interface = { version = "0.58" }
windows-core = { version = "0.58" }
Expand Down
7 changes: 2 additions & 5 deletions komorebi/src/com/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ use windows::Win32::System::Com::CoCreateInstance;
use windows::Win32::System::Com::CoInitializeEx;
use windows::Win32::System::Com::CoUninitialize;
use windows::Win32::System::Com::CLSCTX_ALL;
use windows::Win32::System::Com::COINIT_APARTMENTTHREADED;
use windows::Win32::System::Com::COINIT_MULTITHREADED;
use windows_core::Interface;

struct ComInit();

impl ComInit {
pub fn new() -> Self {
unsafe {
// Notice: Only COINIT_APARTMENTTHREADED works correctly!
//
// Not COINIT_MULTITHREADED or CoIncrementMTAUsage, they cause a seldom crashes in threading tests.
CoInitializeEx(None, COINIT_APARTMENTTHREADED).unwrap();
CoInitializeEx(None, COINIT_MULTITHREADED).unwrap();
}
Self()
}
Expand Down
Loading

0 comments on commit e2f7fe5

Please sign in to comment.