Index: ui/aura/desktop.cc |
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc |
index d08a062c1888b750b34f309433c89db179e8f453..f502fde85052fcc3c1dc2358d071e4a595b7d99d 100644 |
--- a/ui/aura/desktop.cc |
+++ b/ui/aura/desktop.cc |
@@ -44,6 +44,8 @@ static const int kDefaultHostWindowY = 200; |
static const int kDefaultHostWindowWidth = 1280; |
static const int kDefaultHostWindowHeight = 1024; |
+// Returns true if |target| has a non-client (frame) component at |location|, |
+// in window coordinates. |
bool IsNonClientLocation(Window* target, const gfx::Point& location) { |
if (!target->delegate()) |
return false; |
@@ -253,7 +255,9 @@ bool Desktop::DispatchMouseEvent(MouseEvent* event) { |
} |
if (target && target->delegate()) { |
int flags = event->flags(); |
- if (IsNonClientLocation(target, event->location())) |
+ gfx::Point location_in_window = event->location(); |
+ Window::ConvertPointToWindow(this, target, &location_in_window); |
+ if (IsNonClientLocation(target, location_in_window)) |
flags |= ui::EF_IS_NON_CLIENT; |
MouseEvent translated_event(*event, this, target, event->type(), flags); |
return ProcessMouseEvent(target, &translated_event); |