Skip to content

Commit

Permalink
Merge branch 'main' into feature/mac-m3-support
Browse files Browse the repository at this point in the history
  • Loading branch information
haimgel committed Nov 5, 2024
2 parents 01f634e + d889bad commit a8e7550
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
40 changes: 20 additions & 20 deletions examples/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ fn main() {

if monitors.is_empty() {
println!("No external monitors found");
} else {
for mut monitor in monitors {
println!("Monitor");
println!("\tDescription: {}", monitor.description());
if let Some(desc) = monitor.product_name() {
println!("\tProduct Name: {}", desc);
}
if let Some(number) = monitor.serial_number() {
println!("\tSerial Number: {}", number);
}
if let Ok(input) = monitor.get_vcp_feature(0x60) {
println!("\tCurrent input: {:04x}", input.value());
}
return;
}

if let Some(data) = monitor.edid() {
let mut cursor = std::io::Cursor::new(&data);
let mut reader = edid_rs::Reader::new(&mut cursor);
match edid_rs::EDID::parse(&mut reader) {
Ok(edid) => println!("\tEDID Info: {:?}", edid),
_ => println!("\tCould not parse provided EDID information"),
}
for mut monitor in monitors {
println!("Monitor");
println!("\tDescription: {}", monitor.description());
if let Some(desc) = monitor.product_name() {
println!("\tProduct Name: {}", desc);
}
if let Some(number) = monitor.serial_number() {
println!("\tSerial Number: {}", number);
}
if let Ok(input) = monitor.get_vcp_feature(0x60) {
println!("\tCurrent input: {:04x}", input.value());
}
if let Some(data) = monitor.edid() {
let mut cursor = std::io::Cursor::new(&data);
let mut reader = edid_rs::Reader::new(&mut cursor);
match edid_rs::EDID::parse(&mut reader) {
Ok(edid) => println!("\tEDID Info: {:?}", edid),
_ => println!("\tCould not parse provided EDID information"),
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/intel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ fn framebuffer_port_matches_display(port: &IoObject, display: CGDisplay) -> Opti
.find(&display_serial_key)
.and_then(|x| x.downcast::<CFNumber>())
.and_then(|x| x.to_i32())
.map(|x| x as u32)
.unwrap_or(0);
.map_or(0, |x| x as u32);

if display_vendor == display.vendor_number()
&& display_product == display.model_number()
Expand Down

0 comments on commit a8e7550

Please sign in to comment.