Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/xf86-input-ws/dist/src xf86-input-ws: fix bui...
details: https://anonhg.NetBSD.org/xsrc/rev/43abd5afa15d
branches: trunk
changeset: 10806:43abd5afa15d
user: nia <nia%NetBSD.org@localhost>
date: Fri Oct 01 07:14:37 2021 +0000
description:
xf86-input-ws: fix building on xorg-server.old (vax, etc)
not entirely sure that the ABI version check is spot on, but the
relevant changes were made in 2011 so hopefully we only have to
support one old xinput API here.
diffstat:
external/mit/xf86-input-ws/dist/src/ws.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diffs (74 lines):
diff -r 0bb240de0c15 -r 43abd5afa15d external/mit/xf86-input-ws/dist/src/ws.c
--- a/external/mit/xf86-input-ws/dist/src/ws.c Tue Sep 28 07:20:54 2021 +0000
+++ b/external/mit/xf86-input-ws/dist/src/ws.c Fri Oct 01 07:14:37 2021 +0000
@@ -450,10 +450,12 @@
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
axes_labels[HSCROLL_AXIS] =
XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
axes_labels[VSCROLL_AXIS] =
XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
+#endif
if (!InitValuatorClassDeviceStruct(pWS,
NAXES,
axes_labels,
@@ -483,6 +485,7 @@
xf86InitValuatorDefaults(pWS, 1);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
xf86InitValuatorAxisStruct(pWS, HSCROLL_AXIS,
axes_labels[HSCROLL_AXIS], 0, -1, 0, 0, 0, Relative);
xf86InitValuatorAxisStruct(pWS, VSCROLL_AXIS,
@@ -500,6 +503,7 @@
*/
SetScrollValuator(pWS, HSCROLL_AXIS, SCROLL_TYPE_HORIZONTAL, 4096, 0);
SetScrollValuator(pWS, VSCROLL_AXIS, SCROLL_TYPE_VERTICAL, 4096, 0);
+#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
xf86MotionHistoryAllocate(pInfo);
@@ -624,7 +628,9 @@
int buttons = priv->lastButtons;
int dx = 0, dy = 0, dz = 0, dw = 0;
int zbutton = 0, wbutton = 0;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
int hscroll = 0, vscroll = 0;
+#endif
ax = 0; ay = 0;
switch (event->type) {
@@ -674,6 +680,7 @@
DBG(4, ErrorF("Relative W %d\n", event->value));
dw = event->value;
break;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
case WSCONS_EVENT_HSCROLL:
hscroll = event->value;
DBG(4, ErrorF("Horiz. Scrolling %d\n", event->value));
@@ -682,6 +689,7 @@
vscroll = event->value;
DBG(4, ErrorF("Vert. Scrolling %d\n", event->value));
break;
+#endif
default:
xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n",
pInfo->name, event->type);
@@ -726,6 +734,7 @@
buttons |= wbutton;
dw = 0;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
if (hscroll || vscroll) {
xf86Msg(X_WARNING, "%s: hscroll=%d, vscroll=%d\n",
pInfo->name, hscroll, vscroll);
@@ -736,6 +745,7 @@
VSCROLL_AXIS, (double) vscroll);
xf86PostMotionEventM(pInfo->dev, FALSE, priv->scroll_mask);
}
+#endif
if (priv->lastButtons != buttons) {
/* button event */
wsSendButtons(pInfo, buttons);
Home |
Main Index |
Thread Index |
Old Index