mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 22:01:22 +01:00
refactor(windows): maximize and unmaximize go through backend()
The five window.maximize() / unmaximize() calls in workspace.rs become let _ = backend().maximize(id, true/false). The trait already has the capability query (Backend::supports(Capability::Maximize), true on Windows), so no trait change; the Windows daemon does not need to ask, the shared core will. WindowsBackend::maximize runs Window::maximize / unmaximize, which keep the HIDDEN_HWNDS bookkeeping. set_opacity is NOT switched: the adapter's set_opacity is the plain write, while Window::transparent/opaque take the alpha from the transparency manager and animate. BEHAVIOUR: a dead window is skipped (IsWindow first). e2e gate needed: maximizing, commands, workspaces. Verified: Windows clippy -D warnings via tools/fast-check PASS; e2e not run.
This commit is contained in:
1 parent
a43d39635b
commit
5bffe0e93e
1 file changed
+5
-5
@@ -729,7 +729,7 @@ impl Workspace {
|
||||
window.set_position(&adjusted_work_area, true)?;
|
||||
};
|
||||
} else if let Some(window) = &mut self.maximized_window {
|
||||
window.maximize();
|
||||
let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true);
|
||||
} else if !self.containers().is_empty() {
|
||||
// windows that were not what they were told to be since the last layout, which
|
||||
// is something that animations only show once they are done
|
||||
@@ -1198,7 +1198,7 @@ impl Workspace {
|
||||
if let Some(window) = self.maximized_window
|
||||
&& window.hwnd == hwnd
|
||||
{
|
||||
window.unmaximize();
|
||||
let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), false);
|
||||
self.maximized_window = None;
|
||||
self.maximized_window_restore_idx = None;
|
||||
return Ok(());
|
||||
@@ -1888,7 +1888,7 @@ impl Workspace {
|
||||
self.maximized_window = floating_window;
|
||||
self.maximized_window_restore_idx = Option::from(focused_idx);
|
||||
if let Some(window) = self.maximized_window {
|
||||
window.maximize();
|
||||
let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true);
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
@@ -1910,7 +1910,7 @@ impl Workspace {
|
||||
self.maximized_window = Option::from(window);
|
||||
self.maximized_window_restore_idx = monocle_restore_idx;
|
||||
if let Some(window) = self.maximized_window {
|
||||
window.maximize();
|
||||
let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true);
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
@@ -1940,7 +1940,7 @@ impl Workspace {
|
||||
self.maximized_window_restore_idx = Option::from(focused_idx);
|
||||
|
||||
if let Some(window) = self.maximized_window {
|
||||
window.maximize();
|
||||
let _ = backend().maximize(WindowId::from_hwnd(window.hwnd), true);
|
||||
}
|
||||
|
||||
self.focus_previous_container();
|
||||
|
||||
Reference in new issue
Block a user