diff --git a/Cargo.toml b/Cargo.toml index 4b2b57f..035bf18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,13 +18,13 @@ egui_extras = { version = "0.29.1", features = ["all_loaders"]} image = {version = "0.25.3", features = ["jpeg", "png"]} egui_animation = "0.6.0" simple-easing = "1.0.1" -rdev = "0.5.3" log = "0.4.22" env_logger = "0.11.5" re_format = "0.18.2" cap = "0.1.2" clap = {version = "4.5.20", features = ["derive"]} rand = "0.8.5" +display-info = "0.5.1" [profile.dev.package."*"] opt-level = 3 diff --git a/src/app.rs b/src/app.rs index 22f8615..2b63448 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use rdev::display_size; +use display_info::DisplayInfo; use cirrus_theming::Theme; use eframe::egui::{self, Color32, ImageSource, Margin, Rect, Vec2}; @@ -71,7 +71,15 @@ impl eframe::App for Roseate { if !self.image_loaded { let mutable_image = self.image.as_mut().unwrap(); - let (width, height) = display_size().expect("Failed to get monitor size!"); + let all_display_infos = DisplayInfo::all().expect( + "Failed to get information about monitor!" + ); + + let primary_display_apparently = all_display_infos.first().expect( + "Uhhhhh, you don't have a monitor. WHAT!" + ); + + let (width, height) = (primary_display_apparently.width, primary_display_apparently.height); let mut optimizations = Vec::new();