Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1735)

Unified Diff: services/ui/ws/event_matcher.cc

Issue 2788753002: services/ui: make autorepeat work with accelerator. (Closed)
Patch Set: Address review issues. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/event_matcher.cc
diff --git a/services/ui/ws/event_matcher.cc b/services/ui/ws/event_matcher.cc
index 1cd91568adfa074c902c10146cb81be267ce0536..131e974fe97e55b35f654da255830239a777f698 100644
--- a/services/ui/ws/event_matcher.cc
+++ b/services/ui/ws/event_matcher.cc
@@ -76,7 +76,9 @@ EventMatcher::~EventMatcher() {}
bool EventMatcher::MatchesEvent(const ui::Event& event) const {
if ((fields_to_match_ & TYPE) && event.type() != event_type_)
return false;
- int flags = event.flags() & ~ignore_event_flags_;
+ // Synthetic flags should never be matched against.
+ constexpr int kSyntheticFlags = EF_IS_SYNTHESIZED | EF_IS_REPEAT;
+ int flags = event.flags() & ~(ignore_event_flags_ | kSyntheticFlags);
if ((fields_to_match_ & FLAGS) && flags != event_flags_)
return false;
if (fields_to_match_ & KEYBOARD_CODE) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698