From fa2e7351245ab7f2050f605978bbaba43bb32c57 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Oct 2018 11:52:31 +0200 Subject: Fix four switch related warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If4888c1b170568735953ac715c4a7c40de614dd8 Reviewed-by: Jüri Valdmann --- src/core/render_widget_host_view_qt.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 8439b9cd7..86d5d7118 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1030,7 +1030,8 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) return false; } case QEvent::MouseButtonPress: - Focus(); // Fall through. + Focus(); + Q_FALLTHROUGH(); case QEvent::MouseButtonRelease: case QEvent::MouseMove: // Skip second MouseMove event when a window is being adopted, so that Chromium @@ -1051,7 +1052,8 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) handleWheelEvent(static_cast(event)); break; case QEvent::TouchBegin: - Focus(); // Fall through. + Focus(); + Q_FALLTHROUGH(); case QEvent::TouchUpdate: case QEvent::TouchEnd: case QEvent::TouchCancel: @@ -1059,7 +1061,8 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) break; #if QT_CONFIG(tabletevent) case QEvent::TabletPress: - Focus(); // Fall through. + Focus(); + Q_FALLTHROUGH(); case QEvent::TabletRelease: case QEvent::TabletMove: handleTabletEvent(static_cast(event)); -- cgit v1.2.3 From 94bb5644907c16b742d05a6f51cc82785b945f4a Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Oct 2018 11:36:58 +0200 Subject: Remove some outdated Qt version checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't not build with older than Qt 5.9 anyway due to QSG and qmake changes. Change-Id: Iff0247e70d9ffc1e045e2c571f0089d68df9a589 Reviewed-by: Michael Brüning --- src/core/render_widget_host_view_qt.cpp | 50 --------------------------------- 1 file changed, 50 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 86d5d7118..6c5b2ac20 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -90,9 +90,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) #include -#endif #include namespace QtWebEngineCore { @@ -178,55 +176,7 @@ static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const static inline bool isCommonTextEditShortcut(const QKeyEvent *ke) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) return QInputControl::isCommonTextEditShortcut(ke); -#else - if (ke->modifiers() == Qt::NoModifier - || ke->modifiers() == Qt::ShiftModifier - || ke->modifiers() == Qt::KeypadModifier) { - if (ke->key() < Qt::Key_Escape) { - return true; - } else { - switch (ke->key()) { - case Qt::Key_Return: - case Qt::Key_Enter: - case Qt::Key_Delete: - case Qt::Key_Home: - case Qt::Key_End: - case Qt::Key_Backspace: - case Qt::Key_Left: - case Qt::Key_Right: - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_Tab: - return true; - default: - break; - } - } - } else if (ke->matches(QKeySequence::Copy) - || ke->matches(QKeySequence::Paste) - || ke->matches(QKeySequence::Cut) - || ke->matches(QKeySequence::Redo) - || ke->matches(QKeySequence::Undo) - || ke->matches(QKeySequence::MoveToNextWord) - || ke->matches(QKeySequence::MoveToPreviousWord) - || ke->matches(QKeySequence::MoveToStartOfDocument) - || ke->matches(QKeySequence::MoveToEndOfDocument) - || ke->matches(QKeySequence::SelectNextWord) - || ke->matches(QKeySequence::SelectPreviousWord) - || ke->matches(QKeySequence::SelectStartOfLine) - || ke->matches(QKeySequence::SelectEndOfLine) - || ke->matches(QKeySequence::SelectStartOfBlock) - || ke->matches(QKeySequence::SelectEndOfBlock) - || ke->matches(QKeySequence::SelectStartOfDocument) - || ke->matches(QKeySequence::SelectEndOfDocument) - || ke->matches(QKeySequence::SelectAll) - ) { - return true; - } - return false; -#endif } static uint32_t s_eventId = 0; -- cgit v1.2.3 From 36d230c44c7e2f6fccf224b4a0ab5efe77117e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Thu, 20 Sep 2018 10:26:37 +0200 Subject: Stop showing speculative frames Chromium creates "speculative" frames (RenderFrameHost and company) for pending cross-process navigations (and maybe other navigations too). For example, a redirect from http://qt.io to https://qt.io will trigger this, as described in the bug report. These speculative frames are loading in the background and only shown once they are officially ready (as decided by the RenderFrameHostManager and signaled to WebContentsObserver::RenderViewHostChanged). At least, this is how it's supposed to work and how it works in Chrome. In WebEngine, however, we actually show these speculative frames as soon as they are created and before they are ready. This runs into the problem that the if the speculative frame is dropped (instead of committed), then Chromium will not ask us to re-show the old frame (since it hasn't actually asked to us to show the new frame, it naturally assumes we are still showing the old one). Fixes: QTBUG-68727 Change-Id: I9d53035ce60e3a002d5412d4473d940a32644b5d Reviewed-by: Allan Sandfeld Jensen --- src/core/render_widget_host_view_qt.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 6c5b2ac20..0bb28bd37 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -265,7 +265,6 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost *widget , m_adapterClient(0) , m_imeInProgress(false) , m_receivedEmptyImeEvent(false) - , m_initPending(false) , m_imState(0) , m_anchorPositionWithinSelection(-1) , m_cursorPositionWithinSelection(-1) @@ -319,18 +318,10 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC m_adapterClientDestroyedConnection = QObject::connect(adapterClient->holdingQObject(), &QObject::destroyed, [this] { m_adapterClient = nullptr; }); - if (m_initPending) - InitAsChild(0); } void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView) { - if (!m_adapterClient) { - m_initPending = true; - return; - } - m_initPending = false; - m_delegate->initAsChild(m_adapterClient); } void RenderWidgetHostViewQt::InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect& rect) @@ -926,13 +917,13 @@ void RenderWidgetHostViewQt::notifyHidden() void RenderWidgetHostViewQt::windowBoundsChanged() { host()->SendScreenRects(); - if (m_delegate->window()) + if (m_delegate && m_delegate->window()) host()->NotifyScreenInfoChanged(); } void RenderWidgetHostViewQt::windowChanged() { - if (m_delegate->window()) + if (m_delegate && m_delegate->window()) host()->NotifyScreenInfoChanged(); } -- cgit v1.2.3 From b39a5083751605e2ba781393b6b8ea69381efdf4 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 30 Oct 2018 13:30:10 +0100 Subject: Fix background of composition text The Chromium API has been changed: https://chromium-review.googlesource.com/c/chromium/src/+/959006/ Task-number: QTBUG-70289 Task-number: QTBUG-71453 Change-Id: Ib20a82bd826d8067aa3eb3bccccda7d8716e20ad Reviewed-by: Alexandru Croitor --- src/core/render_widget_host_view_qt.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 0bb28bd37..1582cf733 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1235,13 +1235,12 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev) end = qMax(0, start + end); } - QTextCharFormat format = qvariant_cast(attribute.value).toCharFormat(); + underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end, ui::ImeTextSpan::Thickness::kThin, SK_ColorTRANSPARENT)); - QColor underlineColor(0, 0, 0, 0); + QTextCharFormat format = qvariant_cast(attribute.value).toCharFormat(); if (format.underlineStyle() != QTextCharFormat::NoUnderline) - underlineColor = format.underlineColor(); + underlines.back().underline_color = toSk(format.underlineColor()); - underlines.push_back(ui::ImeTextSpan(ui::ImeTextSpan::Type::kComposition, start, end, ui::ImeTextSpan::Thickness::kThin, toSk(underlineColor), SK_ColorTRANSPARENT)); break; } case QInputMethodEvent::Cursor: -- cgit v1.2.3 From 41f8b4883afddf2868beacedaf8270553237ceaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Wed, 31 Oct 2018 12:23:26 +0100 Subject: Fix quicknanobrowser crash on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't call SynchronizeVisualProperties from updatePaintNode Fixes: QTBUG-71430 Change-Id: I6bd231b22c0473f9fd47ca3cdbcb8262f314bd5b Reviewed-by: Michael Brüning --- src/core/render_widget_host_view_qt.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 1582cf733..1c5382fe7 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -690,6 +690,11 @@ void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &lo m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset)); if (contentsSizeChanged) m_adapterClient->updateContentsSize(toQt(m_lastContentsSize)); + + if (m_pendingResize && host()) { + if (host()->SynchronizeVisualProperties()) + m_pendingResize = false; + } } void RenderWidgetHostViewQt::GetScreenInfo(content::ScreenInfo *results) const @@ -890,10 +895,6 @@ void RenderWidgetHostViewQt::OnDidUpdateVisualPropertiesComplete(const cc::Rende QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode) { - if (m_pendingResize && host()) { - if (host()->SynchronizeVisualProperties()) - m_pendingResize = false; - } return m_compositor->updatePaintNode(oldNode); } -- cgit v1.2.3