You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added wintab32-improvements patchset
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
From 495ba38e883f801953cc995817048c9916a86177 Mon Sep 17 00:00:00 2001
|
||||
From: Eriks Dobelis <eriks00@moon.lv>
|
||||
Date: Thu, 31 May 2018 11:38:54 +1000
|
||||
Subject: [PATCH 1/3] winex11: Implement PK_CHANGE for wintab
|
||||
|
||||
---
|
||||
dlls/winex11.drv/wintab.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 53 insertions(+)
|
||||
|
||||
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
|
||||
index e4259bf..f6b89e5 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;
|
||||
+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,50 @@ 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->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 +916,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 +947,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
|
||||
|
@@ -0,0 +1,26 @@
|
||||
From d0fae855025f12e29ce9be1aa0a8204e50fc39e5 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 31 May 2018 11:45:10 +1000
|
||||
Subject: [PATCH 2/3] wintab32: Set lcSysExtX/Y for the first index of
|
||||
WTI_DDCTXS
|
||||
|
||||
---
|
||||
dlls/wintab32/context.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c
|
||||
index 8db6217..fe666a5 100644
|
||||
--- a/dlls/wintab32/context.c
|
||||
+++ b/dlls/wintab32/context.c
|
||||
@@ -410,7 +410,7 @@ static UINT WTInfoT(UINT wCategory, UINT nIndex, LPVOID lpOutput, BOOL bUnicode)
|
||||
pWTInfoW(wCategory, nIndex, &buf);
|
||||
|
||||
/* Handle system extents here, as we can use user32.dll code to set them */
|
||||
- if(wCategory == WTI_DEFSYSCTX)
|
||||
+ if(wCategory == WTI_DEFSYSCTX || wCategory == WTI_DDCTXS)
|
||||
{
|
||||
buf.lcSysExtX = GetSystemMetrics(SM_CXSCREEN);
|
||||
buf.lcSysExtY = GetSystemMetrics(SM_CYSCREEN);
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -0,0 +1,54 @@
|
||||
From 0a77e5d626632db48fd718163f166df47641b182 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 31 May 2018 11:52:09 +1000
|
||||
Subject: [PATCH 3/3] winex11: Handle negative orAltitude values
|
||||
|
||||
---
|
||||
dlls/winex11.drv/wintab.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
|
||||
index f6b89e5..0089266 100644
|
||||
--- a/dlls/winex11.drv/wintab.c
|
||||
+++ b/dlls/winex11.drv/wintab.c
|
||||
@@ -914,6 +914,12 @@ static BOOL motion_event( HWND hwnd, XEvent *event )
|
||||
(abs(motion->axis_data[3]),
|
||||
abs(motion->axis_data[4])))
|
||||
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
|
||||
+
|
||||
+ if (gMsgPacket.pkOrientation.orAltitude < 0)
|
||||
+ {
|
||||
+ FIXME("Negative orAltitude detected\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
gMsgPacket.pkNormalPressure = motion->axis_data[2];
|
||||
gMsgPacket.pkButtons = get_button_state(curnum);
|
||||
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
|
||||
@@ -945,6 +951,12 @@ static BOOL button_event( HWND hwnd, XEvent *event )
|
||||
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(button->axis_data[3]),
|
||||
abs(button->axis_data[4])))
|
||||
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
|
||||
+ if (gMsgPacket.pkOrientation.orAltitude < 0)
|
||||
+ {
|
||||
+ FIXME("Negative orAltitude detected\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
gMsgPacket.pkNormalPressure = button->axis_data[2];
|
||||
gMsgPacket.pkButtons = get_button_state(curnum);
|
||||
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
|
||||
@@ -987,6 +999,11 @@ static BOOL proximity_event( HWND hwnd, XEvent *event )
|
||||
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(proximity->axis_data[3]),
|
||||
abs(proximity->axis_data[4])))
|
||||
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
|
||||
+ if (gMsgPacket.pkOrientation.orAltitude < 0)
|
||||
+ {
|
||||
+ FIXME("Negative orAltitude detected\n");
|
||||
+ return FALSE;
|
||||
+ }
|
||||
gMsgPacket.pkNormalPressure = proximity->axis_data[2];
|
||||
gMsgPacket.pkButtons = get_button_state(curnum);
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
5
patches/wintab32-improvements/definition
Normal file
5
patches/wintab32-improvements/definition
Normal file
@@ -0,0 +1,5 @@
|
||||
Fixes: [11846] Improve pressure sensitivity.
|
||||
Fixes: [15443] Improve Wacom Bambo drawing support
|
||||
Fixes: [18517] Improve eraser from working.
|
||||
|
||||
|
Reference in New Issue
Block a user