Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: eff4fd02027f618b54e9987435e451c6945774e1
      
https://github.com/WebKit/WebKit/commit/eff4fd02027f618b54e9987435e451c6945774e1
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
    M 
Source/WebKit/UIProcess/mac/AppKitGestures/WKMouseTrackingGestureRecognizer.swift
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKPressGestureRecognizer.h
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKPressGestureRecognizer.swift
    M Tools/TestWebKitAPI/Resources/cocoa/custom-slider.html
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

  Log Message:
  -----------
  [AppKit Gestures] Synthesized mouse events always report zero movementX|Y
https://bugs.webkit.org/show_bug.cgi?id=324696
rdar://187970110

Reviewed by Wenson Hsieh.

`MouseEvent.movementX|Y` comes from `-[NSEvent deltaX|Y]`, which read
`kCGMouseEventDeltaX|Y` out of the event's backing CGEvent. An event
built by `+[NSEvent mouseEventWithType:location:...]` has no CGEvent of
its own so those deltas unconditionally read zero. Every mouse event the
mouse tracking and press-drag recognizers deliver is built that way, so
a drag driven by either reports no movement at all.

In this patch, we fix this problem by manually setting deltas on a
CGEvent and rebuilding the NSEvent with it -- as WebAutomationSession
does when simulating mouse interactions.

Test: AppKitGesturesTests.Basic/pressDragOverRangeInputReportsMovement
      AppKitGesturesTests.Basic/pressDragOnImageReportsMovement

* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController mouseTrackingGestureRecognized:]):
(-[WKAppKitGestureController dragPressGestureRecognized:]):
* 
Source/WebKit/UIProcess/mac/AppKitGestures/WKMouseTrackingGestureRecognizer.swift:
(WKMouseTrackingGestureRecognizer.beginTrackingMouse):
(WKMouseTrackingGestureRecognizer.beginTrackingMouseInherited(fromWindowLocation:)):
* Source/WebKit/UIProcess/mac/AppKitGestures/WKPressGestureRecognizer.h:
* Source/WebKit/UIProcess/mac/AppKitGestures/WKPressGestureRecognizer.swift:
(WKPressGestureRecognizer.lastDeliveredLocationInWindow):
(WKPressGestureRecognizer.reset):
(WKPressGestureRecognizer.beginReportingMovement(fromWindowLocation:)):
(WKPressGestureRecognizer.eventReportingMovement(_:atWindowLocation:)):
* Tools/TestWebKitAPI/Resources/cocoa/custom-slider.html:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift:

Canonical link: https://commits.webkit.org/321512@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to