refactor(windows): animation/ghost_dispatcher.rs reads frames through backend().frame()

Every WindowsApi::window_rect(hwnd) in animation/ghost_dispatcher.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:
LGUG2Z committed 2026-10-31 10:29:44 -07:00
1 parent 6a4db7dc5e
commit 387d780aa7
1 file changed
+8 -4
+8 -4
View File
@@ -26,7 +26,9 @@ use crate::stackbar_manager;
use crate::transparency_manager;
use crate::window::Window;
use crate::windows_api::WindowsApi;
use crate::windows_backend::backend;
use color_eyre::eyre;
use komorebi_backend::WindowId;
use parking_lot::Mutex;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;
@@ -320,8 +322,9 @@ impl GhostDispatcher {
/// render target. Those that do have to be laid out are not until they are
/// shown.
fn lay_out_entering_window(&self) {
let is_there =
WindowsApi::window_rect(self.hwnd).is_ok_and(|rect| rect == self.target_rect);
let is_there = backend()
.frame(WindowId::from_hwnd(self.hwnd))
.is_ok_and(|rect| rect == self.target_rect);
if is_there {
return;
@@ -491,8 +494,9 @@ impl GhostDispatcher {
/// swap chain is shown before it is laid out, and not after: laying one out
/// while it is hidden is what leaves it blank or drawn off its place.
fn show_entered_at_once(&self) {
let is_there =
WindowsApi::window_rect(self.hwnd).is_ok_and(|rect| rect == self.target_rect);
let is_there = backend()
.frame(WindowId::from_hwnd(self.hwnd))
.is_ok_and(|rect| rect == self.target_rect);
if is_there {
self.show();