mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-14 04:43:42 +01:00
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.
This commit is contained in:
1 parent
ba22e8dc5a
commit
01b3bd5cea
1 file changed
+7
-8
@@ -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(());
|
||||
|
||||
Reference in new issue
Block a user