Skip to content

Commit

Permalink
fix: prevent crash introduced in v6.70.0 (closes #3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Jun 1, 2024
1 parent 1a3996e commit e16a3d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/logic/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Application: NSObject {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
if let window = (Windows.list.first { $0.isEqualRobust(axWindow, wid) }) {
window.title = title
window.title = window.bestEffortTitle(title)
window.size = size
window.isFullscreen = isFullscreen
window.isMinimized = isMinimized
Expand Down
5 changes: 2 additions & 3 deletions src/logic/events/AccessibilityEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,8 @@ fileprivate func windowTitleChanged(_ element: AXUIElement, _ pid: pid_t) throws
if let wid = try element.cgWindowId() {
let newTitle = try element.title()
DispatchQueue.main.async {
if let window = (Windows.list.first { $0.isEqualRobust(element, wid) }),
newTitle != nil && newTitle != window.title {
window.title = newTitle!
if let window = (Windows.list.first { $0.isEqualRobust(element, wid) }), newTitle != window.title {
window.title = window.bestEffortTitle(newTitle)
App.app.refreshOpenUi([window])
}
}
Expand Down

0 comments on commit e16a3d4

Please sign in to comment.