Skip to content

Instantly share code, notes, and snippets.

@jchv
Created November 15, 2019 09:57
Show Gist options
  • Save jchv/0982329e4c862390882f30a5a81d1cb6 to your computer and use it in GitHub Desktop.
Save jchv/0982329e4c862390882f30a5a81d1cb6 to your computer and use it in GitHub Desktop.
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index fe3d4a8ff4..68c35e68e4 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -304,6 +304,8 @@ static WTPACKET last_packet;
* FIXME: we don't support more than 4 regular tablets or 2 multimode tablets */
#define CURSORMAX 12
static INT button_state[CURSORMAX];
+static INT gCursorX[CURSORMAX];
+static INT gCursorY[CURSORMAX];
static LOGCONTEXTW gSysContext;
static WTI_DEVICES_INFO gSysDevice;
@@ -896,8 +898,8 @@ static BOOL motion_event( HWND hwnd, XEvent *event )
gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(motion->time);
gMsgPacket.pkSerialNumber = gSerial++;
gMsgPacket.pkCursor = curnum;
- gMsgPacket.pkX = motion->axis_data[0];
- gMsgPacket.pkY = motion->axis_data[1];
+ gCursorX[curnum] = gMsgPacket.pkX = motion->axis_data[0];
+ gCursorY[curnum] = gMsgPacket.pkY = motion->axis_data[1];
gMsgPacket.pkOrientation.orAzimuth = figure_deg(motion->axis_data[3],motion->axis_data[4]);
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max
(abs(motion->axis_data[3]),
@@ -929,8 +931,8 @@ static BOOL button_event( HWND hwnd, XEvent *event )
gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(button->time);
gMsgPacket.pkSerialNumber = gSerial++;
gMsgPacket.pkCursor = curnum;
- gMsgPacket.pkX = button->axis_data[0];
- gMsgPacket.pkY = button->axis_data[1];
+ gMsgPacket.pkX = gCursorX[curnum];
+ gMsgPacket.pkY = gCursorY[curnum];
gMsgPacket.pkOrientation.orAzimuth = figure_deg(button->axis_data[3],button->axis_data[4]);
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(button->axis_data[3]),
abs(button->axis_data[4])))
@@ -972,8 +974,8 @@ static BOOL proximity_event( HWND hwnd, XEvent *event )
gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(proximity->time);
gMsgPacket.pkSerialNumber = gSerial++;
gMsgPacket.pkCursor = curnum;
- gMsgPacket.pkX = proximity->axis_data[0];
- gMsgPacket.pkY = proximity->axis_data[1];
+ gCursorX[curnum] = gMsgPacket.pkX = proximity->axis_data[0];
+ gCursorY[curnum] = gMsgPacket.pkY = proximity->axis_data[1];
gMsgPacket.pkOrientation.orAzimuth = figure_deg(proximity->axis_data[3],proximity->axis_data[4]);
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(proximity->axis_data[3]),
abs(proximity->axis_data[4])))
diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c
index 0514dd78b4..9050a12df5 100644
--- a/dlls/wintab32/context.c
+++ b/dlls/wintab32/context.c
@@ -175,7 +175,7 @@ int TABLET_PostTabletMessage(LPOPENCONTEXT newcontext, UINT msg, WPARAM wParam,
return 0;
}
-static inline DWORD ScaleForContext(DWORD In, LONG InOrg, LONG InExt, LONG OutOrg, LONG OutExt)
+static inline DWORD ScaleForContext(ULONGLONG In, LONGLONG InOrg, LONGLONG InExt, LONGLONG OutOrg, LONGLONG OutExt)
{
if (((InExt > 0 )&&(OutExt > 0)) || ((InExt<0) && (OutExt < 0)))
return ((In - InOrg) * abs(OutExt) / abs(InExt)) + OutOrg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment