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

Unified Diff: remoting/webapp/client_session.js

Issue 136093013: Don't send mouse events if the plugin doesn't have focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry upload Created 6 years, 10 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: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 3a78b4e3ccdce11b1a94f414ad21953249e7b753..79aeae2260760793128910145320a4a5979ba61e 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -348,7 +348,11 @@ remoting.ClientSession.prototype.pluginLostFocus_ = function() {
this.plugin_.releaseAllKeys();
if (this.plugin_.element()) {
// Focus should stay on the element, not (for example) the toolbar.
- this.plugin_.element().focus();
+ // Due to crbug.com/246335, we can't restore the focus immediately,
+ // otherwise the plugin gets confused about whether or not it has focus.
+ window.setTimeout(
+ this.plugin_.element().focus.bind(this.plugin_.element()),
+ 0);
weitao 2014/02/07 23:54:23 Nice trick. :)
}
}
};

Powered by Google App Engine
This is Rietveld 408576698