Rebase against 0652a2ccc967c6d1ca04c67f58112ff491ab9a62

This commit is contained in:
Alistair Leslie-Hughes
2019-04-11 08:48:06 +10:00
parent a8556b9c25
commit 72a13348de
10 changed files with 8 additions and 806 deletions

View File

@@ -1,102 +0,0 @@
From 257f0d7fb176f317b8c47e02bf9c4b7fb89f8dfe Mon Sep 17 00:00:00 2001
From: Eriks Dobelis <eriks00@moon.lv>
Date: Thu, 31 May 2018 11:38:54 +1000
Subject: [PATCH] winex11: Implement PK_CHANGE for wintab
---
dlls/winex11.drv/wintab.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index e4259bf..a9ac78a 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -267,6 +267,13 @@ static int proximity_out_type;
static HWND hwndTabletDefault;
static WTPACKET gMsgPacket;
static DWORD gSerial;
+static DWORD lastX = 0xffff;
+static DWORD lastY = 0xffff;
+static UINT lastNormalPressure = 0xffff, lastTangentPressure = 0xffff;
+static DWORD lastButtons = 0xffff;
+static UINT lastCursor = 0xffff;
+static ORIENTATION lastOrientation = {.orAzimuth = 0xffff, .orAltitude = 0xffff, .orTwist = 0xffff };
+static ROTATION lastRotation = {.roPitch = 0xffff, .roRoll = 0xffff, .roYaw = 0xffff };
/* Reference: http://www.wacomeng.com/devsupport/ibmpc/gddevpc.html
*
@@ -839,6 +846,55 @@ static int cursor_from_device(DWORD deviceid, LPWTI_CURSORS_INFO *cursorp)
return -1;
}
+static DWORD get_changed_state( WTPACKET *pkt)
+{
+ DWORD change = 0;
+ if (pkt->pkX != lastX)
+ {
+ change |= PK_X;
+ lastX = pkt->pkX;
+ }
+ if (pkt->pkY != lastY)
+ {
+ change |= PK_Y;
+ lastY = pkt->pkY;
+ }
+ if (pkt->pkNormalPressure != lastNormalPressure)
+ {
+ change |= PK_NORMAL_PRESSURE;
+ lastNormalPressure = pkt->pkNormalPressure;
+ }
+ if (pkt->pkTangentPressure != lastTangentPressure)
+ {
+ change |= PK_TANGENT_PRESSURE;
+ lastTangentPressure = pkt->pkTangentPressure;
+ }
+ if (pkt->pkCursor != lastCursor)
+ {
+ change |= PK_CURSOR;
+ lastCursor = pkt->pkCursor;
+ }
+ if (pkt->pkButtons != lastButtons)
+ {
+ change |= PK_BUTTONS;
+ lastButtons = pkt->pkButtons;
+ }
+ if (pkt->pkOrientation.orAzimuth != lastOrientation.orAzimuth || pkt->pkOrientation.orAltitude != lastOrientation.orAltitude ||
+ pkt->pkOrientation.orTwist != lastOrientation.orTwist)
+ {
+ change |= PK_ORIENTATION;
+ lastOrientation = pkt->pkOrientation;
+ }
+ if (pkt->pkRotation.roPitch != lastRotation.roPitch || pkt->pkRotation.roRoll != lastRotation.roRoll ||
+ pkt->pkRotation.roYaw != lastRotation.roYaw)
+ {
+ change |= PK_ROTATION;
+ lastRotation = pkt->pkRotation;
+ }
+
+ return change;
+}
+
static BOOL motion_event( HWND hwnd, XEvent *event )
{
XDeviceMotionEvent *motion = (XDeviceMotionEvent *)event;
@@ -865,6 +921,7 @@ static BOOL motion_event( HWND hwnd, XEvent *event )
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
gMsgPacket.pkNormalPressure = motion->axis_data[2];
gMsgPacket.pkButtons = get_button_state(curnum);
+ gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
return TRUE;
}
@@ -895,6 +952,7 @@ static BOOL button_event( HWND hwnd, XEvent *event )
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
gMsgPacket.pkNormalPressure = button->axis_data[2];
gMsgPacket.pkButtons = get_button_state(curnum);
+ gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
return TRUE;
}
--
1.9.1