fix: correct triggeredByAccelerator Event property behavior (#18865)
Fixes #18808 Previously, the triggeredByAccelerator flag would be entirely coupled with whether or not the modifier keys were being used or not. This PR swaps out the ui::EventFlagsFromModifiers([event modifierFlags])) call in the macOS code to ui::EventFlagsFromNSEventWithModifiers(event, [event modifierFlags])). The latter outputs flags that take into account mouse click events on top of modifier flags (see Chromium documentation). The business logic to detect triggeredByAccelerator is then changed to exclude any mouse click flags.
This commit is contained in:
parent
6eed4a98ce
commit
e03a40026a
3 changed files with 81 additions and 23 deletions
|
@ -345,7 +345,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
|
|||
if (model) {
|
||||
NSEvent* event = [NSApp currentEvent];
|
||||
model->ActivatedAt(modelIndex,
|
||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||
ui::EventFlagsFromNSEventWithModifiers(event, [event modifierFlags]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue