Skip to content

Commit 3d81eaa

Browse files
committed
Merge branch 'main' of github.com:michidk/displayz
2 parents 555d151 + d388584 commit 3d81eaa

15 files changed

Lines changed: 1493 additions & 515 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ jobs:
1414
with:
1515
command: check
1616

17-
test:
18-
name: Test Suite
19-
runs-on: windows-latest
20-
steps:
21-
- name: Checkout sources
22-
uses: actions/checkout@v6
23-
- name: Run cargo test
24-
uses: actions-rs/cargo@v1
25-
with:
26-
command: test
27-
2817
lints:
2918
name: Lints
3019
runs-on: windows-latest

Cargo.lock

Lines changed: 145 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ categories = ["command-line-utilities", "config"]
1616
color-eyre = "0.6.5"
1717
env_logger = "0.11.8"
1818
log = "0.4.29"
19+
serde = { version = "1.0", features = ["derive"], optional = true }
20+
serde_json = { version = "1.0", optional = true }
1921
structopt = "0.3.26"
2022
thiserror = "2.0.17"
21-
winsafe = { version = "0.0.26", features = ["user"] }
23+
windows = { version = "0.62.2", features = [
24+
"Win32_Graphics_Gdi",
25+
"Win32_Devices_Display",
26+
"Win32_Foundation",
27+
] }
28+
29+
[features]
30+
default = ["json"]
31+
json = ["dep:serde", "dep:serde_json"]

examples/find.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2121
);
2222

2323
// getting the displays properties by index
24-
if let Some(new_primary) = display_set.get(0) {
25-
if let Some(settings) = new_primary.settings() {
26-
println!(
27-
"Position of display with index 0: {}",
28-
(*settings.borrow()).position
29-
);
30-
}
24+
if let Some(new_primary) = display_set.get(0)
25+
&& let Some(settings) = new_primary.settings()
26+
{
27+
println!(
28+
"Position of display with index 0: {}",
29+
settings.borrow().position
30+
);
3131
}
3232

3333
Ok(())

examples/resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2020
eprintln!("Primary display has no settings");
2121
}
2222

23-
display_set.primary().apply()?;
23+
display_set.apply()?;
2424
refresh()?;
2525

2626
Ok(())

examples/upside-down.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2323
eprintln!("Primary display has no settings");
2424
}
2525

26-
display_set.primary().apply()?;
26+
display_set.apply()?;
2727
refresh()?;
2828

2929
Ok(())

0 commit comments

Comments
 (0)