fix: macos, hidpi, resolutions (#11825)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-05-21 16:53:02 +08:00
committed by GitHub
parent b4a30cac73
commit 06ab987e32
5 changed files with 90 additions and 24 deletions

View File

@@ -3093,10 +3093,18 @@ impl Connection {
if virtual_display_manager::amyuni_idd::is_my_display(&name) {
record_changed = false;
}
#[cfg(not(target_os = "macos"))]
let scale = 1.0;
#[cfg(target_os = "macos")]
let scale = display.scale();
let original = (
((display.width() as f64) / scale).round() as _,
(display.height() as f64 / scale).round() as _,
);
if record_changed {
display_service::set_last_changed_resolution(
&name,
(display.width() as _, display.height() as _),
original,
(r.width, r.height),
);
}
@@ -4424,7 +4432,7 @@ mod raii {
*WALLPAPER_REMOVER.lock().unwrap() = None;
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
display_service::reset_resolutions();
display_service::restore_resolutions();
#[cfg(windows)]
let _ = virtual_display_manager::reset_all();
#[cfg(target_os = "linux")]