From f27942078fad8e673abc736372a39b474ad06f80 Mon Sep 17 00:00:00 2001 From: Aki Sakurai Date: Mon, 10 Feb 2025 22:02:16 +0800 Subject: [PATCH] xquartz: fix inverted tablet pen Y tilt on macOS On macOS, the y tilt behavior is inverted; an increase in the tilt value corresponds to tilting the device away from the user. see https://chromium-review.googlesource.com/c/chromium/src/+/2348544 see https://github.com/qt/qtbase/blob/0f128fd7c5a9ee721d1e631743f6eb61d927cf3b/src/plugins/platforms/cocoa/qnsview_tablet.mm#L63 Fixes #792 Part-of: (cherry picked from commit 35622980685afeb34108f547854569e61bd0a142) --- hw/xquartz/X11Application.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index dd96e89f7..6ae5c29df 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1103,7 +1103,7 @@ handle_mouse: else DarwinSendTabletEvents(darwinTabletCurrent, ProximityOut, 0, location.x, location.y, pressure, - tilt.x, tilt.y); + tilt.x, -tilt.y); return; } @@ -1117,7 +1117,7 @@ handle_mouse: if (needsProximityIn) { DarwinSendTabletEvents(darwinTabletCurrent, ProximityIn, 0, location.x, location.y, pressure, - tilt.x, tilt.y); + tilt.x, -tilt.y); needsProximityIn = NO; } @@ -1159,7 +1159,7 @@ handle_mouse: } else { DarwinSendTabletEvents(pDev, ev_type, ev_button, location.x, location.y, pressure, - tilt.x, tilt.y); + tilt.x, -tilt.y); } break; @@ -1186,7 +1186,7 @@ handle_mouse: else DarwinSendTabletEvents(darwinTabletCurrent, ProximityOut, 0, location.x, location.y, pressure, - tilt.x, tilt.y); + tilt.x, -tilt.y); break; case NSScrollWheel: