mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-14 05:14:45 +00:00
Xi: test XIQueryDevice values for relative scroll valuators
XIQueryDevice already reports the current cumulative axisVal for relative scroll valuators. Seed nonzero vertical and horizontal values and verify their FP3232 representation for native and swapped clients.
Signed-off-by: Lukáš Lipinský <18076-Mr-Tao@users.noreply.gitlab.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2292>
(cherry picked from commit 18dbde8971)
(cherry picked from commit 1688dcf08ee721db3b336677d0530b824b6b43a0)
(cherry picked from commit 7c7748e311ea9ad00d9c71e3d00a7a259d77473d)
This commit is contained in:
parent
ecf8c20611
commit
862da1c2e7
1 changed files with 15 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include "dix/inpututils_priv.h"
|
||||
#include "miext/extinit_priv.h"
|
||||
#include "Xext/xinput/handlers.h"
|
||||
|
||||
|
|
@ -256,6 +257,8 @@ reply_XIQueryDevice_data(ClientPtr client, int len, void *data)
|
|||
swapl(&vi->min.frac);
|
||||
swapl(&vi->max.integral);
|
||||
swapl(&vi->max.frac);
|
||||
swapl(&vi->value.integral);
|
||||
swapl(&vi->value.frac);
|
||||
swapl(&vi->resolution);
|
||||
}
|
||||
|
||||
|
|
@ -273,6 +276,15 @@ reply_XIQueryDevice_data(ClientPtr client, int len, void *data)
|
|||
assert(vi->max.integral == -1);
|
||||
assert(vi->max.frac == 0);
|
||||
assert(vi->resolution == 0);
|
||||
|
||||
if (info->deviceid == devices.mouse->id &&
|
||||
(vi->number == 2 || vi->number == 3)) {
|
||||
FP3232 expected = double_to_fp3232(
|
||||
devices.mouse->valuator->axisVal[vi->number]);
|
||||
|
||||
assert(vi->value.integral == expected.integral);
|
||||
assert(vi->value.frac == expected.frac);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -324,6 +336,9 @@ test_XIQueryDevice(void)
|
|||
|
||||
init_simple();
|
||||
|
||||
devices.mouse->valuator->axisVal[2] = 240.5;
|
||||
devices.mouse->valuator->axisVal[3] = -350.25;
|
||||
|
||||
wrapped_dixWriteToClient = reply_XIQueryDevice;
|
||||
request_init(&request, XIQueryDevice);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue