diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index f2ef3102f..be4ee334f 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -73,11 +73,6 @@ class WebEngineView(QWebEngineView): def shutdown(self): self.page().shutdown() - def resizeEvent(self, _event): - widget = self.render_widget() - if widget is not None: - widget.setGeometry(self.rect()) - def createWindow(self, wintype): """Called by Qt when a page wants to create a new window. diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index 908ea6235..9c2101ca7 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -281,6 +281,20 @@ class PseudoLayout(QLayout): def itemAt(self, _pos): return None + def widget(self): + return self.parent().render_widget() + + def setGeometry(self, rect): + widget = self.widget() + if widget is not None: + widget.setGeometry(rect) + + def sizeHint(self): + widget = self.widget() + if widget is not None: + return widget.sizeHint() + return QSize() + class FullscreenNotification(QLabel):