Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 345e3fd2acc0adb2510bc89dbae3b962bef7da60
      
https://github.com/WebKit/WebKit/commit/345e3fd2acc0adb2510bc89dbae3b962bef7da60
  Author: Tim Horton <[email protected]>
  Date:   2026-08-31 (Mon, 31 Aug 2026)

  Changed paths:
    M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift
    A Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/InactiveWindowAppKitGesturesTests.swift

  Log Message:
  -----------
  [AppKit Gestures] Click in a backgrounded window can result in action being 
taken
https://bugs.webkit.org/show_bug.cgi?id=323015
rdar://186280350

Reviewed by Abrar Rahman Protyasha.

If the timing works out such that a click on a window foregrounds the window 
before
we are done with asynchronous click handling, we can let the click through
needlessly. Instead, block it at the source unless Cmd is held down (which
is the usual way to intentionally click-through).

Tests: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/InactiveWindowAppKitGesturesTests.swift

* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(-[WKAppKitGestureController _handleClickBegan:]):
Block click in background windows unless Cmd is held.

* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift:
(NonKeyWindow.canBecomeKey):
(NonKeyWindow.isKeyWindow):
Add some helpers and a window subclass that is never foreground.

* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/InactiveWindowAppKitGesturesTests.swift: Added.
(AppKitGesturesTests.singleClickIntoInactiveWindowIsSuppressed):
Add a test that makes sure that this suppression works.
I was unsuccessful in creating a test for the Cmd inverse case, but tested it 
manually.

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



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

Reply via email to