mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
@@ -65,6 +65,7 @@ final class DetailWebView: WKWebView {
|
||||
|
||||
private var inBigSurOffsetFix = false
|
||||
|
||||
@available(macOS, obsoleted: 12, message: "when minimum deployment > macOS 11 remove bigSurOffsetFix() and calls to it.")
|
||||
private func bigSurOffsetFix() {
|
||||
/*
|
||||
On macOS 11, when a user exits full screen
|
||||
@@ -73,25 +74,30 @@ final class DetailWebView: WKWebView {
|
||||
|
||||
This code adjusts the height of the window by -1pt/+1pt,
|
||||
which puts the webview back in the correct place.
|
||||
|
||||
This code is only executed if currently running on macOS 11
|
||||
*/
|
||||
guard var frame = window?.frame else {
|
||||
return
|
||||
}
|
||||
|
||||
guard !inBigSurOffsetFix else {
|
||||
return
|
||||
}
|
||||
|
||||
inBigSurOffsetFix = true
|
||||
|
||||
defer {
|
||||
inBigSurOffsetFix = false
|
||||
if #unavailable(macOS 12) {
|
||||
guard var frame = window?.frame else {
|
||||
return
|
||||
}
|
||||
|
||||
guard !inBigSurOffsetFix else {
|
||||
return
|
||||
}
|
||||
|
||||
inBigSurOffsetFix = true
|
||||
|
||||
defer {
|
||||
inBigSurOffsetFix = false
|
||||
}
|
||||
|
||||
frame.size = NSSize(width: window!.frame.width, height: window!.frame.height - 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
frame.size = NSSize(width: frame.width, height: frame.height + 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
}
|
||||
|
||||
frame.size = NSSize(width: window!.frame.width, height: window!.frame.height - 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
frame.size = NSSize(width: window!.frame.width, height: window!.frame.height + 1)
|
||||
window!.setFrame(frame, display: false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user