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

Unified Diff: webkit/plugins/npapi/webplugin_delegate_impl_mac.mm

Issue 10169003: Don't send mouse move related events to Cocoa plugins in background windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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: webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
index 00eb86b91e4c295ef871aeebc1b7293c940b011e..3d2ec6d1c5b9e53a65381e6a34597a4e64b4bb4b 100644
--- a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
+++ b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
@@ -520,6 +520,17 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
}
#endif
+ // WebKit sometimes sends spurious mouse move events when the window doesn't
+ // have focus; Cocoa event model plugins don't expect to recieve mouse move
Avi (use Gerrit) 2012/04/20 14:44:01 s/recieve/receive/
stuartmorgan 2012/04/20 15:14:57 Done.
+ // events when they are in a background window, so drop those events.
+ if (!containing_window_has_focus_ &&
+ instance()->event_model() == NPEventModelCocoa &&
Avi (use Gerrit) 2012/04/20 14:44:01 Only the Cocoa event model?
stuartmorgan 2012/04/20 15:14:57 The Carbon event model is a cesspool. There are no
+ (event.type == WebInputEvent::MouseMove ||
+ event.type == WebInputEvent::MouseEnter ||
+ event.type == WebInputEvent::MouseLeave)) {
+ return false;
+ }
+
if (WebInputEvent::isMouseEventType(event.type) ||
event.type == WebInputEvent::MouseWheel) {
// Check our plugin location before we send the event to the plugin, just
« 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