diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 00:16:18 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 00:16:18 +0000 |
commit | 13e4f869b48098bb6ca520df4c4b0481fc7b1507 (patch) | |
tree | e516245f2fe4df13e2cc0108f924b5aba46ad0d3 /views | |
parent | b7c64d66e61a88bd308bb367553c413bdb34bf44 (diff) | |
download | chromium_src-13e4f869b48098bb6ca520df4c4b0481fc7b1507.zip chromium_src-13e4f869b48098bb6ca520df4c4b0481fc7b1507.tar.gz chromium_src-13e4f869b48098bb6ca520df4c4b0481fc7b1507.tar.bz2 |
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
Diffstat (limited to 'views')
-rw-r--r-- | views/desktop/desktop_window_view.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/views/desktop/desktop_window_view.cc b/views/desktop/desktop_window_view.cc index 95aa159..cbba354 100644 --- a/views/desktop/desktop_window_view.cc +++ b/views/desktop/desktop_window_view.cc @@ -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); |