Expand workaround for macOS 11 WebView origin offset bug. Fixes #2916
Move the code that twiddles the window frame from DetailWebView.viewDidEndLiveResize() into a new bigSurOffsetFix() API so it can also be called by setFrameSize() when the frame size is changed outside of a live resize.
This commit is contained in:
parent
8e34187821
commit
bf77d77669
|
@ -53,7 +53,17 @@ final class DetailWebView: WKWebView {
|
|||
override func viewDidEndLiveResize() {
|
||||
super.viewDidEndLiveResize()
|
||||
evaluateJavaScript("document.body.style.overflow = 'visible';", completionHandler: nil)
|
||||
bigSurOffsetFix()
|
||||
}
|
||||
|
||||
override func setFrameSize(_ newSize: NSSize) {
|
||||
super.setFrameSize(newSize)
|
||||
if (!self.inLiveResize) {
|
||||
bigSurOffsetFix()
|
||||
}
|
||||
}
|
||||
|
||||
private func bigSurOffsetFix() {
|
||||
/*
|
||||
On macOS 11, when a user exits full screen
|
||||
or exits zoomed mode by disconnecting an external display
|
||||
|
|
Loading…
Reference in New Issue