Skip to content

Commit

Permalink
Merge branch 'hotfix/1.86.1' into release/1.87.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed May 9, 2024
2 parents 94f3cd9 + 30a663d commit a8fd78f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 184
CURRENT_PROJECT_VERSION = 185
28 changes: 15 additions & 13 deletions DuckDuckGo/Tab/View/WebViewContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,23 @@ final class WebViewContainerView: NSView {
}
.store(in: &cancellables)

fullScreenWindowWillCloseCancellable = NotificationCenter.default.publisher(for: NSWindow.willCloseNotification, object: fullScreenWindow)
.sink { [weak self] notification in
self?.fullScreenWindowWillCloseCancellable = nil
let fullScreenWindowController = (notification.object as? NSWindow)?.windowController
DispatchQueue.main.async { [weak fullScreenWindowController] in
guard let fullScreenWindowController else { return }
// just in case.
// if WKFullScreenWindowController receives `close()` the next time it‘s open it will crash because its _webView is nil
// https://errors.duckduckgo.com/organizations/ddg/issues/3411/?project=6&referrer=release-issue-stream
NSException.try {
fullScreenWindowController.setValue(NSView(), forKeyPath: #keyPath(webView))
// https://app.asana.com/0/72649045549333/1206959015087322/f
if #unavailable(macOS 14.4) {
fullScreenWindowWillCloseCancellable = NotificationCenter.default.publisher(for: NSWindow.willCloseNotification, object: fullScreenWindow)
.sink { [weak self] notification in
self?.fullScreenWindowWillCloseCancellable = nil
let fullScreenWindowController = (notification.object as? NSWindow)?.windowController
DispatchQueue.main.async { [weak fullScreenWindowController] in
guard let fullScreenWindowController else { return }
// just in case.
// if WKFullScreenWindowController receives `close()` the next time it‘s open it will crash because its _webView is nil
// https://errors.duckduckgo.com/organizations/ddg/issues/3411/?project=6&referrer=release-issue-stream
NSException.try {
fullScreenWindowController.setValue(NSView(), forKeyPath: #keyPath(webView))
}
}

}
}
}

}

Expand Down

0 comments on commit a8fd78f

Please sign in to comment.