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

Unified Diff: remoting/host/input_injector_x11.cc

Issue 806223008: Fix input injector on Linux to release all keys before injecting text event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: remoting/host/input_injector_x11.cc
diff --git a/remoting/host/input_injector_x11.cc b/remoting/host/input_injector_x11.cc
index 1852e9fabc50ab43f2b8ca516d3e752f3674eb7c..55690da30319b8511e4c5b33fe732d50e8e43db4 100644
--- a/remoting/host/input_injector_x11.cc
+++ b/remoting/host/input_injector_x11.cc
@@ -327,6 +327,14 @@ void InputInjectorX11::Core::InjectTextEvent(const TextEvent& event) {
return;
}
+ // Release all keys before injecting text event. This is necessary to avoid
+ // any interference with the currently pressed keys. E.g. if Shift is pressed
+ // when TextEvent is received.
+ for (int key : pressed_keys_) {
+ XTestFakeKeyEvent(display_, key, False, CurrentTime);
+ }
+ pressed_keys_.clear();
+
const std::string text = event.text();
for (int32 index = 0; index < static_cast<int32>(text.size()); ++index) {
uint32_t code_point;
« 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