Commit 13e4f869 authored by sadrul@chromium.org's avatar sadrul@chromium.org

views-desktop: Fix sending mousewheel events to the correct view.

Mousewheel events, like keyboard events and unlike other mouseevents, are sent
to the focused view from the focus-manager, instead of sending to the view at
the location of the LocatedEvent. So This needs to be handled from the
dekstop/window-manager to send the events to the focused window.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7462017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96271 0039d316-1c4b-4281-b951-d872f2087c98
parent b7c64d66
......@@ -44,6 +44,16 @@ class DesktopWindow : public Widget {
return native_widget ? native_widget->OnKeyEvent(event) : false;
}
virtual bool OnMouseEvent(const MouseEvent& event) {
if (event.type() == ui::ET_MOUSEWHEEL) {
NativeWidgetViews* native_widget =
desktop_window_view_->active_native_widget();
if (native_widget)
return native_widget->delegate()->OnMouseEvent(event);
}
return Widget::OnMouseEvent(event);
}
DesktopWindowView* desktop_window_view_;
DISALLOW_COPY_AND_ASSIGN(DesktopWindow);
......@@ -178,8 +188,8 @@ void DesktopWindowView::ViewHierarchyChanged(
active_native_widget_ &&
active_native_widget_->GetView() == child) {
active_native_widget_ = NULL;
} else if (child->GetClassName() ==
internal::NativeWidgetView::kViewClassName) {
} else if (is_add &&
child->GetClassName() == internal::NativeWidgetView::kViewClassName) {
internal::NativeWidgetView* native_widget_view =
static_cast<internal::NativeWidgetView*>(child);
native_widget_view->GetAssociatedWidget()->AddObserver(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment