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

Unified Diff: ui/views/corewm/tooltip_controller.cc

Issue 274753002: Ignores mouse motion events when mouse is pressed or drag and drop is in progress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ignores mouse motion events when mouse is pressed or drag and drop is in progress (comment) Created 6 years, 7 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: ui/views/corewm/tooltip_controller.cc
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc
index 500466fdf4d646c69ccba8f31c98ef85a8f9496c..86e9fd6c87ae2d59b8bc94da8d23628da26a732f 100644
--- a/ui/views/corewm/tooltip_controller.cc
+++ b/ui/views/corewm/tooltip_controller.cc
@@ -186,7 +186,14 @@ void TooltipController::OnMouseEvent(ui::MouseEvent* event) {
case ui::ET_MOUSE_MOVED:
case ui::ET_MOUSE_DRAGGED: {
curr_mouse_loc_ = event->location();
- aura::Window* target = GetTooltipTarget(*event, &curr_mouse_loc_);
+ aura::Window* target = NULL;
+ // Avoid a call to gfx::Screen::GetWindowAtScreenPoint() since it can be
+ // very expensive on X11 in cases when the tooltip is hidden anyway.
+ if (tooltips_enabled_ &&
+ !aura::Env::GetInstance()->IsMouseButtonDown() &&
+ !IsDragDropInProgress()) {
+ target = GetTooltipTarget(*event, &curr_mouse_loc_);
+ }
SetTooltipWindow(target);
if (tooltip_timer_.IsRunning())
tooltip_timer_.Reset();
« 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