[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 13:47:55 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2cd95940fd95561207423cabb4990112f172a1e7
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 27 16:20:25 2010 +0000
Give mouse wheel events the right coordinates on Windows
Fixes <http://webkit.org/b/46625> <rdar://problem/8481161> Placing
mouse cursor inside a scrollable area and scrolling the mouse wheel
generally doesn't scroll the area
Reviewed by Sam Weinig.
* Shared/win/WebEventFactory.cpp:
(WebKit::point): Renamed from positionForEvent. The old name implied
that all events used the same relative origin, which is untrue.
(WebKit::WebEventFactory::createWebMouseEvent): Changed to use point
and ::ClientToScreen explicitly rather than relying on
positionForEvent/globalPositionForEvent.
(WebKit::WebEventFactory::createWebWheelEvent): Changed to use point
and ::ScreenToClient. The old code was assuming that wheel event
points are relative to the client area, but they are in fact relative
to the screen.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 5b5a07f..115cc8a 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,24 @@
+2010-09-27 Adam Roben <aroben at apple.com>
+
+ Give mouse wheel events the right coordinates on Windows
+
+ Fixes <http://webkit.org/b/46625> <rdar://problem/8481161> Placing
+ mouse cursor inside a scrollable area and scrolling the mouse wheel
+ generally doesn't scroll the area
+
+ Reviewed by Sam Weinig.
+
+ * Shared/win/WebEventFactory.cpp:
+ (WebKit::point): Renamed from positionForEvent. The old name implied
+ that all events used the same relative origin, which is untrue.
+ (WebKit::WebEventFactory::createWebMouseEvent): Changed to use point
+ and ::ClientToScreen explicitly rather than relying on
+ positionForEvent/globalPositionForEvent.
+ (WebKit::WebEventFactory::createWebWheelEvent): Changed to use point
+ and ::ScreenToClient. The old code was assuming that wheel event
+ points are relative to the client area, but they are in fact relative
+ to the screen.
+
2010-09-27 Sam Weinig <sam at webkit.org>
Reviewed by Adam Roben.
diff --git a/WebKit2/Shared/win/WebEventFactory.cpp b/WebKit2/Shared/win/WebEventFactory.cpp
index 02cc77c..3104f18 100644
--- a/WebKit2/Shared/win/WebEventFactory.cpp
+++ b/WebKit2/Shared/win/WebEventFactory.cpp
@@ -46,19 +46,12 @@ static inline LPARAM relativeCursorPosition(HWND hwnd)
return MAKELPARAM(point.x, point.y);
}
-static inline POINT positionForEvent(HWND hWnd, LPARAM lParam)
+static inline POINT point(LPARAM lParam)
{
POINT point = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
return point;
}
-static inline POINT globalPositionForEvent(HWND hWnd, LPARAM lParam)
-{
- POINT point = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- ::ClientToScreen(hWnd, &point);
- return point;
-}
-
static int horizontalScrollChars()
{
static ULONG scrollChars;
@@ -391,8 +384,9 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(HWND hWnd, UINT message, WPAR
type = WebEvent::KeyDown;
}
- POINT position = positionForEvent(hWnd, lParam);
- POINT globalPosition = globalPositionForEvent(hWnd, lParam);
+ POINT position = point(lParam);
+ POINT globalPosition = position;
+ ::ClientToScreen(hWnd, &globalPosition);
int positionX = position.x;
int positionY = position.y;
@@ -411,8 +405,9 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(HWND hWnd, UINT message, WPAR
// Taken from WebCore
static const float cScrollbarPixelsPerLine = 100.0f / 3.0f;
- POINT position = positionForEvent(hWnd, lParam);
- POINT globalPosition = globalPositionForEvent(hWnd, lParam);
+ POINT globalPosition = point(lParam);
+ POINT position = globalPosition;
+ ::ScreenToClient(hWnd, &position);
int positionX = position.x;
int positionY = position.y;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list