summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 7633aa44c..e2fd074ae 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -538,6 +538,7 @@ void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
ui::CursorType auraType = ui::CursorType::kNull;
#endif
switch (cursorInfo.type) {
+ case ui::CursorType::kNull:
case ui::CursorType::kPointer:
shape = Qt::ArrowCursor;
break;
@@ -561,6 +562,7 @@ void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
case ui::CursorType::kEastWestResize:
case ui::CursorType::kEastPanning:
case ui::CursorType::kWestPanning:
+ case ui::CursorType::kMiddlePanningHorizontal:
shape = Qt::SizeHorCursor;
break;
case ui::CursorType::kNorthResize:
@@ -568,6 +570,7 @@ void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
case ui::CursorType::kNorthSouthResize:
case ui::CursorType::kNorthPanning:
case ui::CursorType::kSouthPanning:
+ case ui::CursorType::kMiddlePanningVertical:
shape = Qt::SizeVerCursor;
break;
case ui::CursorType::kNorthEastResize:
@@ -597,9 +600,15 @@ void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
case ui::CursorType::kProgress:
shape = Qt::BusyCursor;
break;
+ case ui::CursorType::kDndNone:
+ case ui::CursorType::kDndMove:
+ shape = Qt::DragMoveCursor;
+ break;
+ case ui::CursorType::kDndCopy:
case ui::CursorType::kCopy:
shape = Qt::DragCopyCursor;
break;
+ case ui::CursorType::kDndLink:
case ui::CursorType::kAlias:
shape = Qt::DragLinkCursor;
break;
@@ -1009,15 +1018,22 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode)
void RenderWidgetHostViewQt::notifyShown()
{
if (m_enableViz) {
+ // Handle possible frame eviction:
+ if (!m_dfhLocalSurfaceIdAllocator.HasValidLocalSurfaceIdAllocation())
+ m_dfhLocalSurfaceIdAllocator.GenerateId();
if (m_visible)
return;
m_visible = true;
+ }
+
+ host()->WasShown(base::nullopt);
+
+ if (m_enableViz) {
m_delegatedFrameHost->AttachToCompositor(m_uiCompositor.get());
m_delegatedFrameHost->WasShown(GetLocalSurfaceIdAllocation().local_surface_id(),
m_viewRectInDips.size(),
base::nullopt);
}
- host()->WasShown(base::nullopt);
}
void RenderWidgetHostViewQt::notifyHidden()
@@ -1304,6 +1320,14 @@ void RenderWidgetHostViewQt::handleKeyEvent(QKeyEvent *ev)
}
}
+ // Ignore autorepeating KeyRelease events so that the generated web events
+ // conform to the spec, which requires autorepeat to result in a sequence of
+ // keypress events and only one final keyup event:
+ // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Auto-repeat_handling
+ // https://w3c.github.io/uievents/#dom-keyboardevent-repeat
+ if (ev->type() == QEvent::KeyRelease && ev->isAutoRepeat())
+ return;
+
content::NativeWebKeyboardEvent webEvent = WebEventFactory::toWebKeyboardEvent(ev);
if (webEvent.GetType() == blink::WebInputEvent::kRawKeyDown && !m_editCommand.empty()) {
ui::LatencyInfo latency;