Allow webview guests to be resized manually
This adds the `disableguestresize` property for webviews to prevent the webview guest from reacting to size changes of the webview element. This also partially documents the `webContents.setSize` function in order to manually control the webview guest size. These two features can be combined to improve resize performance for e.g. webviews that span the entire window. This greatly reduces the lag described in #6905.
This commit is contained in:
parent
89feefac2c
commit
2986b7bc4a
9 changed files with 212 additions and 3 deletions
|
@ -172,7 +172,8 @@ class WebViewImpl {
|
|||
resizeEvent.newWidth = newSize.width
|
||||
resizeEvent.newHeight = newSize.height
|
||||
this.dispatchEvent(resizeEvent)
|
||||
if (this.guestInstanceId) {
|
||||
if (this.guestInstanceId &&
|
||||
!this.attributes[webViewConstants.ATTRIBUTE_DISABLEGUESTRESIZE].getValue()) {
|
||||
guestViewInternal.setSize(this.guestInstanceId, {
|
||||
normal: newSize
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue