mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-06 03:28:00 +02:00
Move DEFAULT_MOUSE_DPI to filter.h
The filter code is what relies on some default dpi configuration to apply pointer acceleration and expects the input coordinates to be pre-scaled to that resolution. Let's move the define here so we can use it from the touchpad code too. No functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
4f84bad9eb
commit
7e3cc15819
3 changed files with 8 additions and 10 deletions
|
|
@ -932,17 +932,14 @@ tp_init_accel(struct tp_dispatch *tp, double diagonal)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not all touchpads report the same amount of units/mm (resolution).
|
* Not all touchpads report the same amount of units/mm (resolution).
|
||||||
* Normalize motion events to a resolution of 15.74 units/mm
|
* Normalize motion events to the default mouse DPI as base
|
||||||
* (== 400 dpi) as base (unaccelerated) speed. This also evens out any
|
* (unaccelerated) speed. This also evens out any differences in x
|
||||||
* differences in x and y resolution, so that a circle on the
|
* and y resolution, so that a circle on the
|
||||||
* touchpad does not turn into an elipse on the screen.
|
* touchpad does not turn into an elipse on the screen.
|
||||||
*
|
|
||||||
* We pick 400dpi as thats one of the many default resolutions
|
|
||||||
* for USB mice, so we end up with a similar base speed on the device.
|
|
||||||
*/
|
*/
|
||||||
if (res_x > 1 && res_y > 1) {
|
if (res_x > 1 && res_y > 1) {
|
||||||
tp->accel.x_scale_coeff = (400/25.4) / res_x;
|
tp->accel.x_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_x;
|
||||||
tp->accel.y_scale_coeff = (400/25.4) / res_y;
|
tp->accel.y_scale_coeff = (DEFAULT_MOUSE_DPI/25.4) / res_y;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* For touchpads where the driver does not provide resolution, fall
|
* For touchpads where the driver does not provide resolution, fall
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@
|
||||||
|
|
||||||
#define DEFAULT_AXIS_STEP_DISTANCE 10
|
#define DEFAULT_AXIS_STEP_DISTANCE 10
|
||||||
#define DEFAULT_MIDDLE_BUTTON_SCROLL_TIMEOUT 200
|
#define DEFAULT_MIDDLE_BUTTON_SCROLL_TIMEOUT 200
|
||||||
/* The HW DPI rate we normalize to before calculating pointer acceleration */
|
|
||||||
#define DEFAULT_MOUSE_DPI 400
|
|
||||||
|
|
||||||
enum evdev_key_type {
|
enum evdev_key_type {
|
||||||
EVDEV_KEY_TYPE_NONE,
|
EVDEV_KEY_TYPE_NONE,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* The HW DPI rate we normalize to before calculating pointer acceleration */
|
||||||
|
#define DEFAULT_MOUSE_DPI 400
|
||||||
|
|
||||||
struct motion_params {
|
struct motion_params {
|
||||||
double dx, dy; /* in units/ms @ DEFAULT_MOUSE_DPI resolution */
|
double dx, dy; /* in units/ms @ DEFAULT_MOUSE_DPI resolution */
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue