Index: ui/base/win/events_win.cc |
diff --git a/ui/base/win/events_win.cc b/ui/base/win/events_win.cc |
index 9f75b6f18ee02565adb6136f373924c534dcab05..ce1700aae7c65d76a59130222c912e1eb4e7d5ac 100644 |
--- a/ui/base/win/events_win.cc |
+++ b/ui/base/win/events_win.cc |
@@ -211,6 +211,24 @@ gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { |
return gfx::Point(native_point); |
} |
+gfx::Point EventRootLocationFromNative(const base::NativeEvent& native_event) { |
+ // Note: Wheel events are considered client, but their position is in screen |
+ // coordinates. |
+ // Client message. The position is contained in the LPARAM. |
+ if (IsClientMouseEvent(native_event) && !IsMouseWheelEvent(native_event)) |
+ return gfx::Point(native_event.lParam); |
+ DCHECK(IsNonClientMouseEvent(native_event) || |
+ IsMouseWheelEvent(native_event)); |
+ // Non-client message. The position is contained in a POINTS structure in |
+ // LPARAM, and is in screen coordinates so we have to convert to client. |
+ POINT native_point = { GET_X_LPARAM(native_event.lParam), |
+ GET_Y_LPARAM(native_event.lParam) }; |
+ |
+ // TODO(erg): The windows folks say the above is done in screen |
+ // coordinates. Is that equivalent to root coordinates on windows? |
Elliot Glaysher
2012/05/09 19:39:18
attn ben: is this correct for window?
|
+ return gfx::Point(native_point); |
+} |
+ |
KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { |
return KeyboardCodeForWindowsKeyCode(native_event.wParam); |
} |