Skip to content

Commit

Permalink
fix(wm): detect both physical and virtual monitors
Browse files Browse the repository at this point in the history
This commit addresses a regression in v0.1.26 that was introduced by the
win32-display-data crate, where virtual monitors would not be detected
in scans by the wm.

The actual fix has been made upstream in win32-display-data:

LGUG2Z/win32-display-data@2a0f716

fix #846
  • Loading branch information
LGUG2Z committed May 24, 2024
1 parent 88684f9 commit da7a939
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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 komorebi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ windows-interface = { workspace = true }
winput = "0.2"
winreg = "0.52"

win32-display-data = { git = "/~https://github.com/LGUG2Z/win32-display-data" }
win32-display-data = { git = "/~https://github.com/LGUG2Z/win32-display-data", rev = "2a0f7166da154880a1750b91829b1186d9c6a00c" }

[features]
deadlock_detection = []
2 changes: 1 addition & 1 deletion komorebi/src/monitor_reconciliator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn insert_in_monitor_cache(device_id: &str, config: MonitorConfig) {
}

pub fn attached_display_devices() -> color_eyre::Result<Vec<Monitor>> {
Ok(win32_display_data::connected_displays()
Ok(win32_display_data::connected_displays_all()
.flatten()
.map(|display| {
let path = display.device_path;
Expand Down
6 changes: 3 additions & 3 deletions komorebi/src/windows_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl WindowsApi {
}

pub fn valid_hmonitors() -> Result<Vec<(String, isize)>> {
Ok(win32_display_data::connected_displays()
Ok(win32_display_data::connected_displays_all()
.flatten()
.map(|d| {
let name = d.device_name.trim_start_matches(r"\\.\").to_string();
Expand All @@ -232,7 +232,7 @@ impl WindowsApi {
}

pub fn load_monitor_information(monitors: &mut Ring<Monitor>) -> Result<()> {
'read: for display in win32_display_data::connected_displays().flatten() {
'read: for display in win32_display_data::connected_displays_all().flatten() {
let path = display.device_path.clone();
let mut split: Vec<_> = path.split('#').collect();
split.remove(0);
Expand Down Expand Up @@ -790,7 +790,7 @@ impl WindowsApi {
}

pub fn monitor(hmonitor: isize) -> Result<Monitor> {
for display in win32_display_data::connected_displays().flatten() {
for display in win32_display_data::connected_displays_all().flatten() {
if display.hmonitor == hmonitor {
let path = display.device_path;
let mut split: Vec<_> = path.split('#').collect();
Expand Down

0 comments on commit da7a939

Please sign in to comment.