From 01b3bd5cea9a586bab6f876269430c01e702150a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 10:11:28 -0700 Subject: [PATCH] refactor(mac): the live-resize step reads the dragged window's frame through Window Step 11(ii), fifth part. window_manager.rs cloned the dragged window's element out of the workspace only to call MacosApi::window_rect on it; it now asks the Window found in the container for window_rect (the same call on the same element). One raw AX site fewer outside Window. The error is the same one the old call returned, still propagated with ?. Not behaviour. Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified: cannot run on Linux. --- komorebi-for-mac/komorebi/src/window_manager.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/komorebi-for-mac/komorebi/src/window_manager.rs b/komorebi-for-mac/komorebi/src/window_manager.rs index e3c29fe8..c7435da3 100644 --- a/komorebi-for-mac/komorebi/src/window_manager.rs +++ b/komorebi-for-mac/komorebi/src/window_manager.rs @@ -2190,14 +2190,13 @@ impl WindowManager { return Ok(()); } - let element = self - .focused_workspace()? - .container_for_window(window_id) - .and_then(|container| container.windows().iter().find(|w| w.id == window_id)) - .map(|window| window.element.clone()) - .ok_or_eyre("the dragged window is not in a container on the focused workspace")?; - - let now = Rect::from(MacosApi::window_rect(&element)?); + let now = Rect::from( + self.focused_workspace()? + .container_for_window(window_id) + .and_then(|container| container.windows().iter().find(|w| w.id == window_id)) + .ok_or_eyre("the dragged window is not in a container on the focused workspace")? + .window_rect()?, + ); if !self.live_resize_apply(now)? { return Ok(());