mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-04-14 10:54:17 +00:00
Compare commits
19 Commits
submit/uti
...
incubate
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f01c47f3 | ||
|
|
d8536737f1 | ||
|
|
c65932fa4a | ||
|
|
7389ff0bda | ||
|
|
28aa704a2e | ||
|
|
64ba08fc54 | ||
|
|
b695a892d3 | ||
|
|
b952981d05 | ||
|
|
060022b4b3 | ||
|
|
3f1207ebeb | ||
|
|
1ca5d08407 | ||
|
|
7721621c89 | ||
|
|
8644b2724a | ||
|
|
559204d69b | ||
|
|
1b581c5739 | ||
|
|
d1984c55d7 | ||
|
|
ef54aca082 | ||
|
|
40e01ab7be | ||
|
|
e732b6a8e7 |
@@ -43,6 +43,8 @@ m4_ifndef([XORG_MACROS_VERSION],
|
|||||||
XORG_MACROS_VERSION(1.8)
|
XORG_MACROS_VERSION(1.8)
|
||||||
XORG_DEFAULT_OPTIONS
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
|
CFLAGS="$CFLAGS -Wno-declaration-after-statement"
|
||||||
|
|
||||||
# Obtain compiler/linker options from server and required extensions
|
# Obtain compiler/linker options from server and required extensions
|
||||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
||||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ strv_from_string(const char *in, const char *separators, size_t *num_elements)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t strv_len = nelems + 1; /* NULL-terminated */
|
size_t strv_len = nelems + 1; /* NULL-terminated */
|
||||||
char **strv = zalloc(strv_len * sizeof *strv);
|
char **strv = calloc(strv_len, sizeof(*strv));
|
||||||
|
if (!strv)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
size_t idx = 0;
|
size_t idx = 0;
|
||||||
const char *word;
|
const char *word;
|
||||||
|
|||||||
@@ -137,7 +137,10 @@ double_array_from_string(const char *in,
|
|||||||
if(!strv)
|
if(!strv)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
double *numv = zalloc(sizeof(double) * nelem);
|
double *numv = calloc(nelem, sizeof(double));
|
||||||
|
if (!numv)
|
||||||
|
goto out;
|
||||||
|
|
||||||
for (size_t idx = 0; idx < nelem; idx++) {
|
for (size_t idx = 0; idx < nelem; idx++) {
|
||||||
double val;
|
double val;
|
||||||
if (!safe_atod(strv[idx], &val))
|
if (!safe_atod(strv[idx], &val))
|
||||||
|
|||||||
@@ -141,6 +141,10 @@ struct accel_points {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct xf86libinput_pressure_range {
|
||||||
|
float min, max;
|
||||||
|
};
|
||||||
|
|
||||||
struct xf86libinput {
|
struct xf86libinput {
|
||||||
InputInfoPtr pInfo;
|
InputInfoPtr pInfo;
|
||||||
char *path;
|
char *path;
|
||||||
@@ -199,9 +203,7 @@ struct xf86libinput {
|
|||||||
|
|
||||||
float rotation_angle;
|
float rotation_angle;
|
||||||
struct bezier_control_point pressurecurve[4];
|
struct bezier_control_point pressurecurve[4];
|
||||||
struct range {
|
struct xf86libinput_pressure_range pressure_range;
|
||||||
float min, max;
|
|
||||||
} pressure_range;
|
|
||||||
struct ratio {
|
struct ratio {
|
||||||
int x, y;
|
int x, y;
|
||||||
} area;
|
} area;
|
||||||
@@ -467,7 +469,7 @@ xf86libinput_set_pressurecurve(struct xf86libinput *driver_data,
|
|||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
|
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
|
||||||
const struct range *rangeopt)
|
const struct xf86libinput_pressure_range *rangeopt)
|
||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
@@ -939,7 +941,7 @@ LibinputApplyConfigPressureRange(DeviceIntPtr dev,
|
|||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
struct range *rangeopt = &driver_data->options.pressure_range;
|
struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
|
||||||
|
|
||||||
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
|
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
|
||||||
return;
|
return;
|
||||||
@@ -2739,6 +2741,12 @@ xf86libinput_handle_event(struct libinput_event *event)
|
|||||||
break;
|
break;
|
||||||
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
case LIBINPUT_EVENT_SWITCH_TOGGLE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// new libinput events we don't handle yet
|
||||||
|
case LIBINPUT_EVENT_GESTURE_HOLD_BEGIN:
|
||||||
|
case LIBINPUT_EVENT_GESTURE_HOLD_END:
|
||||||
|
case LIBINPUT_EVENT_TABLET_PAD_KEY:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@@ -3685,7 +3693,7 @@ out:
|
|||||||
static void
|
static void
|
||||||
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
|
||||||
struct xf86libinput *driver_data,
|
struct xf86libinput *driver_data,
|
||||||
struct range *rangeopt)
|
struct xf86libinput_pressure_range *rangeopt)
|
||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
@@ -5384,7 +5392,7 @@ LibinputSetPropertyPressureRange(DeviceIntPtr dev,
|
|||||||
InputInfoPtr pInfo = dev->public.devicePrivate;
|
InputInfoPtr pInfo = dev->public.devicePrivate;
|
||||||
struct xf86libinput *driver_data = pInfo->private;
|
struct xf86libinput *driver_data = pInfo->private;
|
||||||
float *vals;
|
float *vals;
|
||||||
struct range rangeopt = { 0.0, 1.0 };
|
struct xf86libinput_pressure_range rangeopt = { 0.0, 1.0 };
|
||||||
|
|
||||||
if (val->format != 32 || val->size != 2 || val->type != prop_float)
|
if (val->format != 32 || val->size != 2 || val->type != prop_float)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
@@ -6663,7 +6671,7 @@ LibinputInitPressureRangeProperty(DeviceIntPtr dev,
|
|||||||
{
|
{
|
||||||
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
#if HAVE_LIBINPUT_PRESSURE_RANGE
|
||||||
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
|
||||||
const struct range *rangeopt = &driver_data->options.pressure_range;
|
const struct xf86libinput_pressure_range *rangeopt = &driver_data->options.pressure_range;
|
||||||
float data[2] = {
|
float data[2] = {
|
||||||
rangeopt->min,
|
rangeopt->min,
|
||||||
rangeopt->max,
|
rangeopt->max,
|
||||||
|
|||||||
Reference in New Issue
Block a user