mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-18 14:48:34 +01:00
refactor(windows): animation/ghost.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in animation/ghost.rs becomes backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is Window::window_rect, i.e. the same DWM call with the Win32 error kept; the callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only the error text can differ: a window that died meanwhile reports WindowGone). BEHAVIOUR: none intended; e2e gate needed: animation scenarios. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
This commit is contained in:
1 parent
c700502f15
commit
370dab364a
1 file changed
+4
-1
@@ -940,6 +940,8 @@ pub fn nudge_swap_chain_window(hwnd: isize, rect: &Rect, top: bool) {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::windows_backend::backend;
|
||||
use komorebi_backend::WindowId;
|
||||
|
||||
#[test]
|
||||
fn swap_chain_classes() {
|
||||
@@ -1193,7 +1195,8 @@ mod tests {
|
||||
|
||||
// the screen is read in pixels, and the windows were put where they are in
|
||||
// the units of a process that the display's scaling is applied to
|
||||
let scale = WindowsApi::window_rect(host.0 as isize)
|
||||
let scale = backend()
|
||||
.frame(WindowId::from_hwnd(host.0 as isize))
|
||||
.map(|rect| f64::from(rect.right) / 800.0)
|
||||
.unwrap_or(1.0);
|
||||
|
||||
|
||||
Reference in new issue
Block a user