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

Unified Diff: ui/aura/window_tree_host_x11.cc

Issue 336403005: Use XInput2 events for keyboard events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO regarding XI2-to-core rewriting. Created 6 years, 6 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
Index: ui/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index c3dcb19f151a1b124bbaba1e75722951e4538cec..d15326e227e6c8a88cd0a30bc84cdb1ac695818a 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -372,14 +372,15 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
compositor()->ScheduleRedrawRect(damage_rect);
break;
}
- case KeyPress: {
- ui::KeyEvent keydown_event(xev, false);
- SendEventToProcessor(&keydown_event);
- break;
- }
+ case KeyPress:
case KeyRelease: {
- ui::KeyEvent keyup_event(xev, false);
- SendEventToProcessor(&keyup_event);
+#if defined(OS_CHROMEOS)
+ // Chrome OS uses XI2 key events instead.
+ if (base::SysInfo::IsRunningOnChromeOS())
+ break;
+#endif
+ ui::KeyEvent key_event(xev, false);
+ SendEventToProcessor(&key_event);
break;
}
case ButtonPress:
@@ -699,6 +700,16 @@ void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) {
SendEventToProcessor(&scrollev);
break;
}
+ case ui::ET_KEY_PRESSED:
+ case ui::ET_KEY_RELEASED: {
+#if defined(OS_CHROMEOS)
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ ui::KeyEvent key_event(xev, false);
+ SendEventToProcessor(&key_event);
+ }
+#endif
+ break;
+ }
case ui::ET_UMA_DATA:
break;
case ui::ET_UNKNOWN:

Powered by Google App Engine
This is Rietveld 408576698