refactor resolution, mid commit

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou committed 2023-05-18 23:46:53 +08:00
1 parent 154b86d2a5
commit a603e046e3
9 files changed
+196 -55

No files matched your search

+4
View File
@@ -1888,6 +1888,10 @@ pub fn change_resolution(name: &str, width: usize, height: usize) -> ResultType<
if FALSE == EnumDisplaySettingsW(NULL as _, ENUM_CURRENT_SETTINGS, &mut dm) {
bail!("EnumDisplaySettingsW failed, errno={}", GetLastError());
}
// to-do: check if need change
println!("REMOVE ME ========================== dm ({},{}) to ({},{})", dm.dmPelsWidth, dm.dmPelsHeight, width, height);
let wname = wide_string(name);
let len = if wname.len() <= dm.dmDeviceName.len() {
wname.len()