| 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();
|
|
|