xwayland: Add wheel axis to relative pointer
The relative pointer only has 2 axis, if we want to route the mouse wheel events to that device, we need to add the axis definition, similar to what is done for the absolute pointer. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
This commit is contained in:
parent
7181792824
commit
1abab61dc2
|
@ -177,7 +177,7 @@ xwl_pointer_proc(DeviceIntPtr device, int what)
|
||||||
static int
|
static int
|
||||||
xwl_pointer_proc_relative(DeviceIntPtr device, int what)
|
xwl_pointer_proc_relative(DeviceIntPtr device, int what)
|
||||||
{
|
{
|
||||||
#define NAXES 2
|
#define NAXES 4
|
||||||
Atom axes_labels[NAXES] = { 0 };
|
Atom axes_labels[NAXES] = { 0 };
|
||||||
|
|
||||||
switch (what) {
|
switch (what) {
|
||||||
|
@ -186,6 +186,8 @@ xwl_pointer_proc_relative(DeviceIntPtr device, int what)
|
||||||
|
|
||||||
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
||||||
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
||||||
|
axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL);
|
||||||
|
axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We'll never send buttons, but XGetPointerMapping might in certain
|
* We'll never send buttons, but XGetPointerMapping might in certain
|
||||||
|
@ -203,6 +205,13 @@ xwl_pointer_proc_relative(DeviceIntPtr device, int what)
|
||||||
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
||||||
InitValuatorAxisStruct(device, 1, axes_labels[1],
|
InitValuatorAxisStruct(device, 1, axes_labels[1],
|
||||||
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
||||||
|
InitValuatorAxisStruct(device, 2, axes_labels[2],
|
||||||
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
||||||
|
InitValuatorAxisStruct(device, 3, axes_labels[3],
|
||||||
|
NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative);
|
||||||
|
|
||||||
|
SetScrollValuator(device, 2, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE);
|
||||||
|
SetScrollValuator(device, 3, SCROLL_TYPE_VERTICAL, 1.0, SCROLL_FLAG_PREFERRED);
|
||||||
|
|
||||||
if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control))
|
if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control))
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
Loading…
Reference in New Issue