| Index: content/browser/renderer_host/render_widget_host_view_mac.mm
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| index 4bbf13f0be7f533b4700161c86e22e63c83846a8..d66e4c4303d801a9000ba8ad7b97540bbdd866d5 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| @@ -1910,11 +1910,21 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged(
|
|
|
| // Set the pointer type when we are receiving a NSMouseEntered event and the
|
| // following NSMouseExited event should have the same pointer type.
|
| + // For NSMouseExited and NSMouseEntered events, they do not have a subtype.
|
| + // We decide their pointer types by checking if we recevied a
|
| + // NSTabletProximity event.
|
| NSEventType type = [theEvent type];
|
| - if (type == NSMouseEntered) {
|
| + if (type == NSMouseEntered || type == NSMouseExited) {
|
| pointerType_ = isStylusEnteringProximity_
|
| - ? blink::WebPointerProperties::PointerType::Pen
|
| + ? pointerType_
|
| : blink::WebPointerProperties::PointerType::Mouse;
|
| + } else {
|
| + NSEventSubtype subtype = [theEvent subtype];
|
| + // For other mouse events and touchpad events, the pointer type is mouse.
|
| + if (subtype != NSTabletPointEventSubtype &&
|
| + subtype != NSTabletProximityEventSubtype) {
|
| + pointerType_ = blink::WebPointerProperties::PointerType::Mouse;
|
| + }
|
| }
|
|
|
| if ([self shouldIgnoreMouseEvent:theEvent]) {
|
| @@ -1987,8 +1997,14 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged(
|
| }
|
|
|
| - (void)tabletEvent:(NSEvent*)theEvent {
|
| - if ([theEvent type] == NSTabletProximity)
|
| + if ([theEvent type] == NSTabletProximity) {
|
| isStylusEnteringProximity_ = [theEvent isEnteringProximity];
|
| + NSPointingDeviceType deviceType = [theEvent pointingDeviceType];
|
| + // For all tablet events, the pointer type will be pen or eraser.
|
| + pointerType_ = deviceType == NSEraserPointingDevice
|
| + ? blink::WebPointerProperties::PointerType::Eraser
|
| + : blink::WebPointerProperties::PointerType::Pen;
|
| + }
|
| }
|
|
|
| - (BOOL)performKeyEquivalent:(NSEvent*)theEvent {
|
|
|