Index: ui/views/widget/native_widget_win.cc |
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc |
index 2123600168a169c4d30f013f019e2a742a678971..f46284f567dd29ef1d3d0f1e6bf28b96a3e59d8c 100644 |
--- a/ui/views/widget/native_widget_win.cc |
+++ b/ui/views/widget/native_widget_win.cc |
@@ -743,11 +743,32 @@ void NativeWidgetWin::HandleNativeBlur(HWND focused_window) { |
} |
bool NativeWidgetWin::HandleMouseEvent(const ui::MouseEvent& event) { |
- ui::MouseEvent dpi_event(event); |
- dpi_event.set_location(ui::win::ScreenToDIPPoint(event.location())); |
- dpi_event.set_root_location(ui::win::ScreenToDIPPoint(event.location())); |
- delegate_->OnMouseEvent(&dpi_event); |
- return dpi_event.handled(); |
+ if (event.IsMouseWheelEvent()) { |
+ ui::MouseWheelEvent dpi_event(event, |
+ static_cast<const ui::MouseWheelEvent&>(event).x_offset() / |
+ ui::win::GetDeviceScaleFactor(), |
+ static_cast<const ui::MouseWheelEvent&>(event).y_offset() / |
+ ui::win::GetDeviceScaleFactor()); |
sadrul
2013/06/24 02:09:35
Most of the ui::Events are copyable. Looks like Mo
girard
2013/06/24 20:37:07
If we do this, we'd still need the static_cast in
|
+ dpi_event.set_location(ui::win::ScreenToDIPPoint(event.location())); |
+ dpi_event.set_root_location(ui::win::ScreenToDIPPoint(event.location())); |
+ delegate_->OnMouseEvent(&dpi_event); |
+ return dpi_event.handled(); |
+ } else if (event.IsScrollEvent()) { |
sadrul
2013/06/24 02:09:35
scroll events (i.e. ET_SCROLL*) are never generate
girard
2013/06/24 20:37:07
Thanks - cleaned this up. (I was trying to be more
|
+ ui::ScrollEvent dpi_event(static_cast<const ui::ScrollEvent&>(event)); |
+ dpi_event.Scale(1/ui::win::GetDeviceScaleFactor()); |
+ dpi_event.set_location(ui::win::ScreenToDIPPoint(event.location())); |
+ dpi_event.set_root_location(ui::win::ScreenToDIPPoint(event.location())); |
+ delegate_->OnMouseEvent(&dpi_event); |
+ return dpi_event.handled(); |
+ } else if (event.IsMouseEvent()) { |
+ ui::MouseEvent dpi_event(event); |
+ dpi_event.set_location(ui::win::ScreenToDIPPoint(event.location())); |
+ dpi_event.set_root_location(ui::win::ScreenToDIPPoint(event.location())); |
+ delegate_->OnMouseEvent(&dpi_event); |
+ return dpi_event.handled(); |
+ } |
+ NOTREACHED(); |
+ return false; |
} |
bool NativeWidgetWin::HandleKeyEvent(const ui::KeyEvent& event) { |