summaryrefslogtreecommitdiffstats
path: root/ui/events/ozone/evdev/keyboard_evdev.cc
diff options
context:
space:
mode:
authorspang <spang@chromium.org>2014-10-21 08:08:39 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-21 15:08:59 +0000
commit0abb227c87a36d12e52976466ea7f62f3945e8af (patch)
tree72aedf30435d20c22c5886b1cbe014bcedc8bc46 /ui/events/ozone/evdev/keyboard_evdev.cc
parent69e698364a0a82a806fc5a4994c5f2040d1ff083 (diff)
downloadchromium_src-0abb227c87a36d12e52976466ea7f62f3945e8af.zip
chromium_src-0abb227c87a36d12e52976466ea7f62f3945e8af.tar.gz
chromium_src-0abb227c87a36d12e52976466ea7f62f3945e8af.tar.bz2
ozone: evdev: Dispatch events in task
This limits the amount of code that must be reentrant in the case of nested message loops. In particular libgestures is not reentrant; this fixes getting some modifiers stuck down with a context menu open. BUG=418787 TEST=manual on link_freon Review URL: https://codereview.chromium.org/661353006 Cr-Commit-Position: refs/heads/master@{#300488}
Diffstat (limited to 'ui/events/ozone/evdev/keyboard_evdev.cc')
-rw-r--r--ui/events/ozone/evdev/keyboard_evdev.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/events/ozone/evdev/keyboard_evdev.cc b/ui/events/ozone/evdev/keyboard_evdev.cc
index 6e5266f..468f0fd 100644
--- a/ui/events/ozone/evdev/keyboard_evdev.cc
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc
@@ -228,12 +228,11 @@ void KeyboardEvdev::DispatchKey(unsigned int key, bool down) {
ui::KeyboardCode code = KeyboardCodeFromEvdevKey(key);
int flags = modifiers_->GetModifierFlags();
- KeyEvent key_event(
+ callback_.Run(make_scoped_ptr(new KeyEvent(
down ? ET_KEY_PRESSED : ET_KEY_RELEASED,
code,
KeycodeConverter::NativeKeycodeToCode(key + kXkbKeycodeOffset),
- flags);
- callback_.Run(&key_event);
+ flags)));
}
} // namespace ui