fix: closing fullscreen window would glitch it (closes #5029)

This commit is contained in:
lwouis committed 2025-11-24 11:19:43 +01:00
1 parent 168995493f
commit ee436cc7cc
1 file changed
+11 -3
+11 -3
View File
@@ -121,9 +121,17 @@ class Window {
guard let self else { return }
if self.isFullscreen {
try? self.axUiElement!.setAttribute(kAXFullscreenAttribute, false)
}
if let closeButton_ = try? self.axUiElement!.closeButton() {
try? closeButton_.performAction(kAXPressAction)
// minimizing is ignored if sent immediatly; we wait for the de-fullscreen animation to be over
BackgroundWork.accessibilityCommandsQueue.addOperationAfter(deadline: .now() + .seconds(1)) { [weak self] in
guard let self else { return }
if let closeButton_ = try? self.axUiElement!.closeButton() {
try? closeButton_.performAction(kAXPressAction)
}
}
} else {
if let closeButton_ = try? self.axUiElement!.closeButton() {
try? closeButton_.performAction(kAXPressAction)
}
}
}
}