DescriptionMacViews: Implement capture using NSEvent local+global monitors
This allows drag&drop to work, and Menus to dismiss themselves properly.
Adds a CocoaMouseCapture to encapsulate the logic to simulate
::SetCapture() from Windows APIs. "Cocoa" because it uses the cocoa APIs
on NSEvent rather than Quartz APIs from CoreGraphics to intercept mouse
events. (Quartz allows events sent to other applications to be
suppressed as well as monitored, but we don't want that).
Allows the WidgetCaptureTests in widget_interactive_test.cc to pass. One
test was failing because the widget could not activate, so the code in
native_widget_mac_interactive_uitest.mm that was setting the activation
policy is moved to views_test_helper_mac.mm.
BUG=403679
Committed: https://crrev.com/20cd5d3a1e1ff560fff0edfc736bc1ce6cd895a7
Cr-Commit-Position: refs/heads/master@{#308886}
Patch Set 1 : some nits #Patch Set 2 : NULL -> nullptr #Patch Set 3 : 4xWidgetCaptureTest.* green #Patch Set 4 : events_mac change not needed #Patch Set 5 : selfnits #
Total comments: 4
Patch Set 6 : #ifdef -> MAYBE_ #Patch Set 7 : whoops - remove stray GetContext() #
Total comments: 2
Patch Set 8 : fix sorting #
Messages
Total messages: 18 (8 generated)
|