summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@openbsd.org>2009-11-23 16:55:52 +0000
committerMatthieu Herrb <matthieu@openbsd.org>2009-11-23 16:55:52 +0000
commita51215ab2ac8e6d42c5d8ee5ec5207b35820c217 (patch)
tree7722ee84966fbeb02a1887b7e9b08f3114598a70
parentbc3a428df118bd6bb4bcfcd6d0f22bf9ead5795b (diff)
- fix parameter orders for XInput 2 xf86InitValuatorAxisStruct() calls
- set min/max axis values for absolute valuators
-rw-r--r--src/ws.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ws.c b/src/ws.c
index b61e99c..f5a4e7e 100644
--- a/src/ws.c
+++ b/src/ws.c
@@ -31,6 +31,7 @@
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include <xf86Xinput.h>
+#include <exevents.h>
#include <xisb.h>
#include <mipointer.h>
#include <extinit.h>
@@ -365,7 +366,7 @@ wsDeviceInit(DeviceIntPtr pWS)
InputInfoPtr pInfo = (InputInfoPtr)pWS->public.devicePrivate;
WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS);
unsigned char map[NBUTTONS + 1];
- int i;
+ int i, xmin, xmax, ymin, ymax;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
Atom btn_labels[NBUTTONS] = {0};
Atom axes_labels[NAXES] = {0};
@@ -391,6 +392,18 @@ wsDeviceInit(DeviceIntPtr pWS)
map))
return !Success;
+ if (priv->type == WSMOUSE_TYPE_TPANEL) {
+ xmin = priv->min_x;
+ xmax = priv->max_x;
+ ymin = priv->min_y;
+ ymax = priv->max_y;
+ } else {
+ xmin = -1;
+ xmax = -1;
+ ymin = -1;
+ ymax = -1;
+ }
+
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
if ((priv->type == WSMOUSE_TYPE_TPANEL)) {
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
@@ -415,18 +428,18 @@ wsDeviceInit(DeviceIntPtr pWS)
if (!InitPtrFeedbackClassDeviceStruct(pWS, wsControlProc))
return !Success;
- xf86InitValuatorAxisStruct(pWS,
+ xf86InitValuatorAxisStruct(pWS, 0,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[0],
#endif
- 0, 0, -1, 1, 0, 1);
+ xmin, xmax, 1, 0, 1);
xf86InitValuatorDefaults(pWS, 0);
- xf86InitValuatorAxisStruct(pWS,
+ xf86InitValuatorAxisStruct(pWS, 1,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[1],
#endif
- 1, 0, -1, 1, 0, 1);
+ ymin, ymax, 1, 0, 1);
xf86InitValuatorDefaults(pWS, 1);
xf86MotionHistoryAllocate(pInfo);
AssignTypeAndName(pWS, pInfo->atom, pInfo->name);