Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: ui/events/win/events_win.cc

Issue 133053004: Ensure that trackpad and trackpoint scrolling works on Windows desktop Aura with legacy trackpad dr… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/win/events_win.cc
===================================================================
--- ui/events/win/events_win.cc (revision 244237)
+++ ui/events/win/events_win.cc (working copy)
@@ -90,6 +90,11 @@
native_event.message == WM_SYSKEYUP;
}
+bool IsScrollEvent(const base::NativeEvent& native_event) {
+ return native_event.message == WM_VSCROLL ||
+ native_event.message == WM_HSCROLL;
+}
+
// Returns a mask corresponding to the set of pressed modifier keys.
// Checks the current global state and the state sent by client mouse messages.
int KeyStateFlagsFromNative(const base::NativeEvent& native_event) {
@@ -179,6 +184,9 @@
case WM_MOUSELEAVE:
case WM_NCMOUSELEAVE:
return ET_MOUSE_EXITED;
+ case WM_VSCROLL:
+ case WM_HSCROLL:
+ return ET_SCROLL;
default:
// We can't NOTREACHED() here, since this function can be called for any
// message.
@@ -206,11 +214,16 @@
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) };
+ IsMouseWheelEvent(native_event) || IsScrollEvent(native_event));
+ POINT native_point;
+ if (IsScrollEvent(native_event)) {
+ ::GetCursorPos(&native_point);
+ } else {
+ // 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.
+ native_point.x = GET_X_LPARAM(native_event.lParam);
+ native_point.y = GET_Y_LPARAM(native_event.lParam);
+ }
ScreenToClient(native_event.hwnd, &native_point);
gfx::Point location(native_point);
location = gfx::win::ScreenToDIPPoint(location);
@@ -294,8 +307,10 @@
float* x_offset_ordinal,
float* y_offset_ordinal,
int* finger_count) {
- // Not supported in Windows.
- NOTIMPLEMENTED();
+ // TODO(ananta)
+ // Support retrieving the scroll offsets from the scroll event.
+ if (native_event.message == WM_VSCROLL || native_event.message == WM_HSCROLL)
+ return true;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698