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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 850833004: Fix shelf dimming on secondary display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 32262778e1f447660bc78d99c6319e944f9babda..96e75ce478ab819ff8c7b95e119871cf20770067 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -36,6 +36,7 @@
#include "ui/views/accessible_pane_view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
+#include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/easy_resize_window_targeter.h"
#include "ui/wm/public/activation_client.h"
@@ -213,7 +214,11 @@ void DimmerView::DimmerEventFilter::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_MOVED &&
event->type() != ui::ET_MOUSE_DRAGGED)
return;
- bool inside = owner_->GetBoundsInScreen().Contains(event->root_location());
+
+ gfx::Point screen_point(event->location());
+ ::wm::ConvertPointToScreen(static_cast<aura::Window*>(event->target()),
+ &screen_point);
+ bool inside = owner_->GetBoundsInScreen().Contains(screen_point);
if (mouse_inside_ || touch_inside_ != inside || touch_inside_)
owner_->SetHovered(inside || touch_inside_);
mouse_inside_ = inside;
@@ -222,8 +227,12 @@ void DimmerView::DimmerEventFilter::OnMouseEvent(ui::MouseEvent* event) {
void DimmerView::DimmerEventFilter::OnTouchEvent(ui::TouchEvent* event) {
bool touch_inside = false;
if (event->type() != ui::ET_TOUCH_RELEASED &&
- event->type() != ui::ET_TOUCH_CANCELLED)
- touch_inside = owner_->GetBoundsInScreen().Contains(event->root_location());
+ event->type() != ui::ET_TOUCH_CANCELLED) {
+ gfx::Point screen_point(event->location());
+ ::wm::ConvertPointToScreen(static_cast<aura::Window*>(event->target()),
+ &screen_point);
+ touch_inside = owner_->GetBoundsInScreen().Contains(screen_point);
+ }
if (mouse_inside_ || touch_inside_ != mouse_inside_ || touch_inside)
owner_->SetHovered(mouse_inside_ || touch_inside);
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698