summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp')
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
index 2fb03f02..36ea5015 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -201,6 +201,22 @@ void RenderWidgetHostViewQtDelegateWidget::resizeEvent(QResizeEvent *resizeEvent
m_client->notifyResize();
}
+void RenderWidgetHostViewQtDelegateWidget::showEvent(QShowEvent *event)
+{
+ QOpenGLWidget::showEvent(event);
+ // We don't have a way to catch a top-level window change with QWidget
+ // but a widget will most likely be shown again if it changes, so do
+ // the reconnection at this point.
+ foreach (const QMetaObject::Connection &c, m_windowConnections)
+ disconnect(c);
+ m_windowConnections.clear();
+ if (QWindow *w = window()) {
+ m_windowConnections.append(connect(w, SIGNAL(xChanged(int)), SLOT(onWindowPosChanged())));
+ m_windowConnections.append(connect(w, SIGNAL(yChanged(int)), SLOT(onWindowPosChanged())));
+ }
+ m_client->windowChanged();
+}
+
bool RenderWidgetHostViewQtDelegateWidget::event(QEvent *event)
{
bool handled = false;
@@ -248,3 +264,8 @@ void RenderWidgetHostViewQtDelegateWidget::paintGL()
m_sgRenderer->renderScene(defaultFramebufferObject());
}
+
+void RenderWidgetHostViewQtDelegateWidget::onWindowPosChanged()
+{
+ m_client->windowBoundsChanged();
+}