Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDE Wayland 屏幕分辨率获取错误 #165

Open
TTsdzb opened this issue Nov 28, 2024 · 0 comments
Open

KDE Wayland 屏幕分辨率获取错误 #165

TTsdzb opened this issue Nov 28, 2024 · 0 comments

Comments

@TTsdzb
Copy link

TTsdzb commented Nov 28, 2024

系统为 Arch Linux,KDE Wayland。我设置了屏幕缩放为 1.25,导致获取到的屏幕宽和高是缩放前的宽高。

举个例子,我的屏幕实际分辨率为 1080P:

println!("Resolution: {}x{}", monitor.width(), monitor.height());
println!(
    "Real resolution: {}x{}",
    monitor.width() as f32 * monitor.scale_factor(),
    monitor.height() as f32 * monitor.scale_factor()
);

输出如下结果:

Resolution: 1536x864
Real resolution: 1920x1080

但实际上,截图保存后的图片仍为 1080P,此时图片宽高就与获取到的屏幕宽高不符了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant