mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-24 17:48:34 +02:00
fix(komorebi): don't scale for DPI, as we're not DPI aware
This fixes a regression from 344e6ad2fd
that assumed we were declared DPI aware.
This commit is contained in:
@@ -499,9 +499,11 @@ impl WindowsApi {
|
|||||||
let mut rect = unsafe { std::mem::zeroed() };
|
let mut rect = unsafe { std::mem::zeroed() };
|
||||||
|
|
||||||
if Self::dwm_get_window_attribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &mut rect).is_ok() {
|
if Self::dwm_get_window_attribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &mut rect).is_ok() {
|
||||||
let window_scale = unsafe { GetDpiForWindow(hwnd) };
|
// TODO(raggi): once we declare DPI awareness, we will need to scale the rect.
|
||||||
let system_scale = unsafe { GetDpiForSystem() };
|
// let window_scale = unsafe { GetDpiForWindow(hwnd) };
|
||||||
Ok(Rect::from(rect).scale(system_scale.try_into()?, window_scale.try_into()?))
|
// let system_scale = unsafe { GetDpiForSystem() };
|
||||||
|
// Ok(Rect::from(rect).scale(system_scale.try_into()?, window_scale.try_into()?))
|
||||||
|
Ok(Rect::from(rect))
|
||||||
} else {
|
} else {
|
||||||
unsafe { GetWindowRect(hwnd, &mut rect) }.process()?;
|
unsafe { GetWindowRect(hwnd, &mut rect) }.process()?;
|
||||||
Ok(Rect::from(rect))
|
Ok(Rect::from(rect))
|
||||||
|
|||||||
Reference in New Issue
Block a user