mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 13:51:19 +01:00
refactor(windows): scrolling.rs reads frames through backend().frame()
Every WindowsApi::window_rect(hwnd) in scrolling.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: scrolling. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
This commit is contained in:
1 parent
14b6112453
commit
6a4db7dc5e
1 file changed
+3
-2
@@ -18,9 +18,10 @@ use crate::core::Rect;
|
||||
use crate::core::ScrollingLayoutOptions;
|
||||
use crate::core::Sizing;
|
||||
use crate::core::WindowHandlingBehaviour;
|
||||
use crate::windows_api::WindowsApi;
|
||||
use crate::windows_backend::backend;
|
||||
use crate::workspace::Workspace;
|
||||
use color_eyre::eyre;
|
||||
use komorebi_backend::WindowId;
|
||||
use komorebi_layouts::scrolling;
|
||||
use komorebi_layouts::scrolling::ScrollingPlacement;
|
||||
use komorebi_scrolling::ColumnWidth;
|
||||
@@ -201,7 +202,7 @@ impl Workspace {
|
||||
.iter()
|
||||
// a window that is hidden has not been where it was told to be
|
||||
.filter(|window| !crate::HIDDEN_HWNDS.lock().contains(&window.hwnd))
|
||||
.filter_map(|window| WindowsApi::window_rect(window.hwnd).ok())
|
||||
.filter_map(|window| backend().frame(WindowId::from_hwnd(window.hwnd)).ok())
|
||||
.map(|actual| actual.right - placed.right)
|
||||
.max()
|
||||
.unwrap_or_default();
|
||||
|
||||
Reference in new issue
Block a user