Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40aef6e8d9b7122f619a2d1e6b53b2a53bdaa005
      
https://github.com/WebKit/WebKit/commit/40aef6e8d9b7122f619a2d1e6b53b2a53bdaa005
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-01-26 (Mon, 26 Jan 2026)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebKit/Platform/spi/mac/AppKitSPI.h
    M Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm

  Log Message:
  -----------
  [AppKit Gestures] Refactor input handling to support NSClickGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=306055
rdar://168696567

Reviewed by Aditya Keerthi and Tim Horton.

Re-land 306125@main with a fix for NSGestureRecognizer.modifierFlags API
availability on macOS downlevels.

This commit teaches WKWebView (through WKAppKitGestureController) to
support click interactions driven by NSClickGestureRecognizer.

To achieve this, we configure a click gesture recognizer and add it to
WKWebView, inspired by prior art in 303084@main.

More details in-line.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebKit/Platform/spi/mac/AppKitSPI.h:
  For platforms where NSGestureRecognizer.modifierFlags is not API,
  provide an equivalent SPI declaration.
* Source/WebKit/UIProcess/mac/WKAppKitGestureController.mm:
(-[WKAppKitGestureController configureForClicking:]):
(-[WKAppKitGestureController initWithPage:viewImpl:]):
(-[WKAppKitGestureController setUpPanGestureRecognizer]):
(-[WKAppKitGestureController setUpClickGestureRecognizer]):
  Introduce helper methods to set up the different gesture recognizers
  maintained by WKAppKitGestureController.
(-[WKAppKitGestureController addGesturesToWebView]):
(-[WKAppKitGestureController enableGesturesIfNeeded]):
(-[WKAppKitGestureController enableGestureIfNeeded:]):
  Similarly, introduce helper methods to enable recognizers and add to
  the gesture hierarchy as appropriate.
(-[WKAppKitGestureController clickGestureRecognized:]):
  The click gesture recognizer action that goes from gesture recognition
  state to simulating mouseUp/Down at the NSApp layer. Looking forward,
  we can also subsume some of the work done by the NSResponder overrides
  in WebViewImpl here.
(isSamePair):
(-[WKAppKitGestureController 
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKAppKitGestureController enablePanGestureIfNeeded]): Deleted.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::windowNumber):
  Introduce a helper method to query the web view's associated window
  number directly from WebViewImpl.

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



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

Reply via email to