Windows QPA: Fix wheel events when using -platform windows:reverse
Wheel events in WM_POINTER messages use global coordinates. Move the code doing the RTL correction into the local coordinates branch. Fixes: QTBUG-117499 Task-number: QTBUG-28463 Pick-to: 6.5 Change-Id: I10e965da9e9660985eaa2681fcf780b5388299a2 Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Timothée Keller <timothee.keller@qt.io> (cherry picked from commit 78512135c83b92944a0d897d4f387c8e358160bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b65e1141da
commit
6ac543c843
@ -739,20 +739,20 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window,
|
|||||||
{
|
{
|
||||||
*result = 0;
|
*result = 0;
|
||||||
|
|
||||||
QPoint eventPos(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
|
|
||||||
if ((et & QtWindows::NonClientEventFlag) == 0 && QWindowsBaseWindow::isRtlLayout(hwnd)) {
|
|
||||||
RECT clientArea;
|
|
||||||
GetClientRect(hwnd, &clientArea);
|
|
||||||
eventPos.setX(clientArea.right - eventPos.x());
|
|
||||||
}
|
|
||||||
|
|
||||||
QPoint localPos;
|
QPoint localPos;
|
||||||
QPoint globalPos;
|
QPoint globalPos;
|
||||||
|
QPoint eventPos(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
|
||||||
|
|
||||||
if ((et == QtWindows::MouseWheelEvent) || (et & QtWindows::NonClientEventFlag)) {
|
if ((et == QtWindows::MouseWheelEvent) || (et & QtWindows::NonClientEventFlag)) {
|
||||||
globalPos = eventPos;
|
globalPos = eventPos;
|
||||||
localPos = QWindowsGeometryHint::mapFromGlobal(hwnd, eventPos);
|
localPos = QWindowsGeometryHint::mapFromGlobal(hwnd, eventPos);
|
||||||
} else {
|
} else {
|
||||||
|
if (QWindowsBaseWindow::isRtlLayout(hwnd)) {
|
||||||
|
RECT clientArea;
|
||||||
|
GetClientRect(hwnd, &clientArea);
|
||||||
|
eventPos.setX(clientArea.right - eventPos.x());
|
||||||
|
}
|
||||||
|
|
||||||
globalPos = QWindowsGeometryHint::mapToGlobal(hwnd, eventPos);
|
globalPos = QWindowsGeometryHint::mapToGlobal(hwnd, eventPos);
|
||||||
auto targetHwnd = hwnd;
|
auto targetHwnd = hwnd;
|
||||||
if (auto *pw = window->handle())
|
if (auto *pw = window->handle())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user