From 7717f941a349140497d5e689530a2bf31e8397da Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 18 Aug 2014 14:11:06 +0200 Subject: Propagate the page's screen coordinates when the top-level window moved This fixes a regression after the 37 upgrade where the select popups would have the wrong position. Adjust to the new behavior and also avoid doing a mapToGlobal of the position received in InitAsPopup. RWHV::SetBounds has been giving us screen coordinates since the Chromium 33 update, but popup locations somehow managed to work properly through some side-effect sorcery. This also fixes the value of window.screen[XY] in JavaScript which wasn't updated when the window was moved. Change-Id: I544499bafedccfb7d389b4abc48f1386c398473f Reviewed-by: Pierre Rossi --- .../render_widget_host_view_qt_delegate_widget.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h') diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h index 68553b8e8..756ad3c14 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h @@ -58,8 +58,8 @@ class QSGRootNode; class QWindow; QT_END_NAMESPACE -class RenderWidgetHostViewQtDelegateWidget : public QOpenGLWidget, public RenderWidgetHostViewQtDelegate -{ +class RenderWidgetHostViewQtDelegateWidget : public QOpenGLWidget, public RenderWidgetHostViewQtDelegate { + Q_OBJECT public: RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent = 0); @@ -81,13 +81,17 @@ public: virtual void setTooltip(const QString &tooltip) Q_DECL_OVERRIDE; protected: - bool event(QEvent *event); - void resizeEvent(QResizeEvent *resizeEvent); + bool event(QEvent *event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *resizeEvent) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *) Q_DECL_OVERRIDE; void initializeGL() Q_DECL_OVERRIDE; void paintGL() Q_DECL_OVERRIDE; QVariant inputMethodQuery(Qt::InputMethodQuery query) const; +private slots: + void onWindowPosChanged(); + private: RenderWidgetHostViewQtDelegateClient *m_client; // Put the root node first to make sure it gets destroyed after the SG renderer. @@ -95,6 +99,7 @@ private: QScopedPointer m_sgEngine; QScopedPointer m_sgRenderer; bool m_isPopup; + QList m_windowConnections; }; #endif -- cgit v1.2.3