refactor(mac): give Window a close operation

Adds Window::close (Backend::close): the same press of the close button
that AdhocWindow::close does on a bare element, applied to the Window's
element. Nothing calls it yet; MacosBackend switches to it in the next
step. No behaviour change: the daemon's own close command still goes through
AdhocWindow on the foreground element, because it has no Window there.

Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
This commit is contained in:
LGUG2Z committed 2026-10-31 10:01:04 -07:00
1 parent 803a141088
commit ecaa3e1516
1 file changed
+5
+5
View File
@@ -814,6 +814,11 @@ impl Window {
AccessibilityApi::set_attribute_cf_value(&self.element, kAXMinimizedAttribute, value)
}
/// Closes the window by pressing its close button (`Backend::close`); `Ok` when it has none.
pub fn close(&self) -> Result<(), AccessibilityError> {
AdhocWindow::close(&self.element.0)
}
#[tracing::instrument(skip_all)]
pub fn restore(&mut self) -> Result<(), AccessibilityError> {
// waiting for what is on its way to the window is not something to do with a lock held