[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][xorg-team/driver/xserver-xorg-input-libinput][upstream-unstable] 7 commits: Improve documentation of the custom acceleration profile



Title: GitLab

Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / driver / xserver-xorg-input-libinput

Commits:

  • 57b049d3
    by Yinon Burgansky at 2023-04-26T01:33:46+03:00
    Improve documentation of the custom acceleration profile
    
  • 141aa867
    by Peter Hutterer at 2023-06-08T14:14:37+10:00
    Change the capabilities to an enum
    
    Slightly nicer for debugging.
    
  • a4dfadee
    by Peter Hutterer at 2023-06-08T14:14:37+10:00
    Initialize the left-handed property for tablet tools
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    
  • 94a52a84
    by Peter Hutterer at 2023-06-15T15:09:31+10:00
    tablet: map BTN_STYLUS3 to button 8
    
    Buttons 4-7 are out of bounds for hysterical historical reasons.
    Previously this button fell through to the default statement and
    resulted in 8 + BTN_STYLUS3 - BTN_SIDE == 65 which is rather obviously
    wrong.
    
    Instead, map it explicitly to what the fourth button would be mapped to
    on other devices. This will now overlap with BTN_SIDE on devices that
    both BTN_STYLUS3 *and* BTN_SIDE but those devices don't appear to exist
    in the real world.
    
    Fixes #50
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    
  • 310db420
    by Peter Hutterer at 2023-07-03T13:33:19+10:00
    Don't run past the last element in the list
    
    If there is no (other) libinput device in the current device list, we'd
    eventually end up with next == NULL, causing a segfault.
    
    Fixes #60
    
  • 5e20d16d
    by Peter Hutterer at 2023-07-10T09:05:19+10:00
    Don't try to enable a NULL device
    
    If there is no other libinput device in our list (and next is thus NULL),
    skip the xf86AddEnabledDevice() call.
    
    Fixes #60
    
  • 46af622e
    by Peter Hutterer at 2023-08-25T13:51:18+10:00
    xf86-input-libinput 1.4.0
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    

4 changed files:

Changes:

  • configure.ac
    ... ... @@ -23,7 +23,7 @@
    23 23
     # Initialize Autoconf
    
    24 24
     AC_PREREQ([2.60])
    
    25 25
     AC_INIT([xf86-input-libinput],
    
    26
    -        [1.3.0],
    
    26
    +        [1.4.0],
    
    27 27
             [https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
    
    28 28
             [xf86-input-libinput])
    
    29 29
     AC_CONFIG_SRCDIR([Makefile.am])
    

  • man/libinput.man
    ... ... @@ -54,23 +54,29 @@ on the profiles and their behavior, see the libinput documentation.
    54 54
     .BI "Option \*qAccelSpeed\*q \*q" float \*q
    
    55 55
     Sets the pointer acceleration speed within the range [-1, 1].
    
    56 56
     This only applies to the flat or adaptive profile.
    
    57
    -.BI "Option \*AccelPointsFallback\*q \*q" string \*q
    
    58
    -Sets the points of the Fallback acceleration function, (see the libinput documentation).
    
    57
    +.TP 7
    
    58
    +.BI "Option \*qAccelPointsFallback\*q \*q" string \*q
    
    59
    +.TQ
    
    60
    +.BI "Option \*qAccelPointsMotion\*q \*q" string \*q
    
    61
    +.TQ
    
    62
    +.BI "Option \*qAccelPointsScroll\*q \*q" string \*q
    
    63
    +Sets the points of the Fallback/Motion/Scroll acceleration functions.
    
    59 64
     The string must be a space-separated list of floating point non-negative numbers, e.g.
    
    60 65
     "0.0 1.0 2.4 2.5".
    
    61 66
     This only applies to the custom profile.
    
    62
    -.BI "Option \*AccelStepFallback\*q \*q" float \*q
    
    63
    -Sets the step between the points of the Fallback acceleration function, (see the libinput documentation).
    
    64
    -When a step of 0.0 is provided, libinput's default Fallback acceleration function is used.
    
    67
    +See section
    
    68
    +.B CUSTOM ACCELERATION PROFILE
    
    69
    +.TP 7
    
    70
    +.BI "Option \*qAccelStepFallback\*q \*q" float \*q
    
    71
    +.TQ
    
    72
    +.BI "Option \*qAccelStepMotion\*q \*q" float \*q
    
    73
    +.TQ
    
    74
    +.BI "Option \*qAccelStepScroll\*q \*q" float \*q
    
    75
    +Sets the step between the points of the Fallback/Motion/Scroll acceleration functions.
    
    76
    +When a step of 0.0 is provided, libinput's Fallback acceleration function is used.
    
    65 77
     This only applies to the custom profile.
    
    66
    -.BI "Option \*AccelPointsMotion\*q \*q" string \*q
    
    67
    -Equivalent to AccelPointsFallback but applies to the Motion acceleration function.
    
    68
    -.BI "Option \*AccelStepMotion\*q \*q" float \*q
    
    69
    -Equivalent to AccelStepFallback but applies to the Motion acceleration function.
    
    70
    -.BI "Option \*AccelPointsScroll\*q \*q" string \*q
    
    71
    -Equivalent to AccelPointsFallback but applies to the Scroll acceleration function.
    
    72
    -.BI "Option \*AccelStepScroll\*q \*q" float \*q
    
    73
    -Equivalent to AccelStepFallback but applies to the Scroll acceleration function.
    
    78
    +See section
    
    79
    +.B CUSTOM ACCELERATION PROFILE
    
    74 80
     .TP 7
    
    75 81
     .BI "Option \*qButtonMapping\*q \*q" string \*q
    
    76 82
     Sets the logical button mapping for this device, see
    
    ... ... @@ -247,15 +253,41 @@ on the device. The following properties are provided by the
    247 253
     driver.
    
    248 254
     .TP 7
    
    249 255
     .BI "libinput Accel Profiles Available"
    
    250
    -2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
    
    256
    +3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
    
    251 257
     Indicates which acceleration profiles are available on this device.
    
    252 258
     .TP 7
    
    253 259
     .BI "libinput Accel Profile Enabled"
    
    254
    -2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
    
    260
    +3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
    
    255 261
     Indicates which acceleration profile is currently enabled on this device.
    
    256 262
     .TP 7
    
    257 263
     .BI "libinput Accel Speed"
    
    258
    -1 32-bit float value, defines the pointer speed. Value range -1, 1
    
    264
    +1 32-bit float value, defines the pointer speed. Value range -1, 1.
    
    265
    +This only applies to the flat or adaptive profile.
    
    266
    +.TP 7
    
    267
    +.BI "libinput Accel Custom Fallback Points"
    
    268
    +.TQ
    
    269
    +.BI "libinput Accel Custom Motion Points"
    
    270
    +.TQ
    
    271
    +.BI "libinput Accel Custom Scroll Points"
    
    272
    +A space-separated list of 32-bit floating point non-negative numbers, e.g.
    
    273
    +"0.0 1.0 2.4 2.5".
    
    274
    +Sets the points of the Fallback/Motion/Scroll acceleration functions.
    
    275
    +This only applies to the custom profile.
    
    276
    +See section
    
    277
    +.B CUSTOM ACCELERATION PROFILE
    
    278
    +.TP 7
    
    279
    +.BI "libinput Accel Custom Fallback Step"
    
    280
    +.TQ
    
    281
    +.BI "libinput Accel Custom Motion Step"
    
    282
    +.TQ
    
    283
    +.BI "libinput Accel Custom Scroll Step"
    
    284
    +1 32-bit float value, sets the step between the points of the
    
    285
    +Fallback/Motion/Scroll acceleration functions.
    
    286
    +When a step of 0.0 is provided, libinput's Fallback acceleration
    
    287
    +function is used.
    
    288
    +This only applies to the custom profile.
    
    289
    +See section
    
    290
    +.B CUSTOM ACCELERATION PROFILE
    
    259 291
     .TP 7
    
    260 292
     .BI "libinput Button Scrolling Button"
    
    261 293
     1 32-bit value. Sets the button number to use for button scrolling. This
    
    ... ... @@ -449,6 +481,35 @@ libinput provides scroll data in pixels. The \fBScrollPixelDistance\fR
    449 481
     option defines the amount of movement equivalent to one wheel click. For
    
    450 482
     example, a value of 50 means the user has to move a finger by 50 pixels to
    
    451 483
     generate one logical click event and each pixel is 1/50th of a wheel click.
    
    484
    +
    
    485
    +.SH CUSTOM ACCELERATION PROFILE
    
    486
    +The custom pointer acceleration profile gives users full control over the
    
    487
    +acceleration behavior at different speeds. libinput exposes an acceleration
    
    488
    +function f(x) where the x-axis is the device speed in device units per millisecond
    
    489
    +and the y-axis is the pointer speed.
    
    490
    +.PP
    
    491
    +The custom acceleration function is defined using n points which are spaced
    
    492
    +uniformly along the x-axis, starting from 0 and continuing in constant steps.
    
    493
    +Thus the points defining the custom function are:
    
    494
    +.EX
    
    495
    +(0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1])
    
    496
    +.EE
    
    497
    +When a velocity value does not lie exactly on those points,
    
    498
    +a linear interpolation/extrapolation of the two closest points will be calculated.
    
    499
    +.PP
    
    500
    +There are 3 custom acceleration function, which are used for different movement types:
    
    501
    +.TS
    
    502
    +tab(;) allbox;
    
    503
    +l l l.
    
    504
    +Movement type; Uses; supported by
    
    505
    +Fallback; Catch-all default movement type; All devices
    
    506
    +Motion; Used for pointer motion; All devices
    
    507
    +Scroll; Used for scroll movement; Mouse, Touchpad
    
    508
    +.TE
    
    509
    +.PP
    
    510
    +See libinput library documentation of more details:
    
    511
    +https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile
    
    512
    +
    
    452 513
     .SH BUGS
    
    453 514
     This driver does not work with \fBOption \*qDevice\*q\fR set to an event
    
    454 515
     node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR. This can be
    

  • meson.build
    1 1
     project('xf86-input-libinput', 'c',
    
    2
    -        version: '1.3.0',  # bump version in configure.ac
    
    2
    +        version: '1.4.0',  # bump version in configure.ac
    
    3 3
             default_options: ['warning_level=2'],
    
    4 4
             meson_version: '>= 0.50.0')
    
    5 5
     
    

  • src/xf86libinput.c
    ... ... @@ -80,13 +80,15 @@
    80 80
     #define TABLET_STRIP_AXIS_MAX 4096
    
    81 81
     #define TABLET_RING_AXIS_MAX 71
    
    82 82
     
    
    83
    -#define CAP_KEYBOARD	0x1
    
    84
    -#define CAP_POINTER	0x2
    
    85
    -#define CAP_TOUCH	0x4
    
    86
    -#define CAP_TABLET	0x8
    
    87
    -#define CAP_TABLET_TOOL	0x10
    
    88
    -#define CAP_TABLET_PAD	0x20
    
    89
    -#define CAP_GESTURE	0x40
    
    83
    +enum capabilities {
    
    84
    +	CAP_KEYBOARD = 0x1,
    
    85
    +	CAP_POINTER = 0x2,
    
    86
    +	CAP_TOUCH = 0x4,
    
    87
    +	CAP_TABLET = 0x8,
    
    88
    +	CAP_TABLET_TOOL = 0x10,
    
    89
    +	CAP_TABLET_PAD = 0x20,
    
    90
    +	CAP_GESTURE = 0x40,
    
    91
    +};
    
    90 92
     
    
    91 93
     #if HAVE_INPUTPROTO24
    
    92 94
     #if ABI_XINPUT_VERSION >= SET_ABI_VERSION(24, 4)
    
    ... ... @@ -254,6 +256,7 @@ btn_linux2xorg(unsigned int b)
    254 256
     	/* tablet button range */
    
    255 257
     	case BTN_STYLUS: button = 2; break;
    
    256 258
     	case BTN_STYLUS2: button = 3; break;
    
    259
    +	case BTN_STYLUS3: button = 8; break;
    
    257 260
     	default:
    
    258 261
     		button = 8 + b - BTN_SIDE;
    
    259 262
     		break;
    
    ... ... @@ -730,7 +733,7 @@ LibinputApplyConfigLeftHanded(DeviceIntPtr dev,
    730 733
     {
    
    731 734
     	InputInfoPtr pInfo = dev->public.devicePrivate;
    
    732 735
     
    
    733
    -	if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
    
    736
    +	if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET|CAP_TABLET_TOOL))
    
    734 737
     		return;
    
    735 738
     
    
    736 739
     	if (libinput_device_config_left_handed_is_available(device) &&
    
    ... ... @@ -1497,12 +1500,13 @@ swap_registered_device(InputInfoPtr pInfo)
    1497 1500
     		return;
    
    1498 1501
     
    
    1499 1502
     	next = xf86FirstLocalDevice();
    
    1500
    -	while (next == pInfo || !is_libinput_device(next))
    
    1503
    +	while (next && (next == pInfo || !is_libinput_device(next)))
    
    1501 1504
     		next = next->next;
    
    1502 1505
     
    
    1503 1506
     	input_lock();
    
    1504 1507
     	xf86RemoveEnabledDevice(pInfo);
    
    1505
    -	xf86AddEnabledDevice(next);
    
    1508
    +	if (next)
    
    1509
    +		xf86AddEnabledDevice(next);
    
    1506 1510
     	driver_context.registered_InputInfoPtr = next;
    
    1507 1511
     	input_unlock();
    
    1508 1512
     }
    
    ... ... @@ -5726,7 +5730,7 @@ LibinputInitLeftHandedProperty(DeviceIntPtr dev,
    5726 5730
     {
    
    5727 5731
     	BOOL left_handed = driver_data->options.left_handed;
    
    5728 5732
     
    
    5729
    -	if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
    
    5733
    +	if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET|CAP_TABLET_TOOL))
    
    5730 5734
     		return;
    
    5731 5735
     
    
    5732 5736
     	if (!libinput_device_config_left_handed_is_available(device) ||
    


  • Reply to: