diff --git a/driver/mprops.c b/driver/mprops.c index e6eb073..a611c1d 100644 --- a/driver/mprops.c +++ b/driver/mprops.c @@ -29,7 +29,7 @@ # define LOG_DEBUG_PROPS LOG_DISABLED #endif -#define MAX_INT_VALUES 4 +#define MAX_INT_VALUES 5 #define MAX_FLOAT_VALUES 4 #define MAX_BUTTON_VALUES 6 @@ -253,7 +253,8 @@ void mprops_init(struct MConfig* cfg, InputInfoPtr local) { ivals[1] = cfg->drag_timeout; ivals[2] = cfg->drag_wait; ivals[3] = cfg->drag_dist; - mprops.drag_settings = atom_init_integer(local->dev, MTRACK_PROP_DRAG_SETTINGS, 4, ivals, 32); + ivals[4] = cfg->drag_lock_timeout; + mprops.drag_settings = atom_init_integer(local->dev, MTRACK_PROP_DRAG_SETTINGS, 5, ivals, 32); ivals[0] = cfg->axis_x_invert; ivals[1] = cfg->axis_y_invert; @@ -704,7 +705,7 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop } #endif else if (property == mprops.drag_settings) { - if (prop->size != 4 || prop->format != 32 || prop->type != XA_INTEGER) + if (prop->size != 5 || prop->format != 32 || prop->type != XA_INTEGER) return BadMatch; ivals32 = (uint32_t*)prop->data; @@ -716,8 +717,10 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop cfg->drag_timeout = ivals32[1]; cfg->drag_wait = ivals32[2]; cfg->drag_dist = ivals32[3]; - LOG_DEBUG_PROPS("set drag settings to %d %d %d %d\n", - cfg->drag_enable, cfg->drag_timeout, cfg->drag_wait, cfg->drag_dist); + cfg->drag_lock_timeout = ivals32[4]; + + LOG_DEBUG_PROPS("set drag settings to %d %d %d %d %d\n", + cfg->drag_enable, cfg->drag_timeout, cfg->drag_wait, cfg->drag_dist, cfg->drag_lock_timeout); } } else if (property == mprops.axis_invert) { diff --git a/include/mconfig.h b/include/mconfig.h index 7d80bba..5857092 100644 --- a/include/mconfig.h +++ b/include/mconfig.h @@ -105,6 +105,7 @@ #define DEFAULT_DRAG_TIMEOUT 350 #define DEFAULT_DRAG_WAIT 40 #define DEFAULT_DRAG_DIST 200 +#define DEFAULT_DRAG_LOCK_TIMEOUT 500 #define DEFAULT_AXIS_X_INVERT 0 #define DEFAULT_AXIS_Y_INVERT 0 #define DEFAULT_SENSITIVITY 1.0 diff --git a/include/mprops.h b/include/mprops.h index 12602f7..565b61a 100644 --- a/include/mprops.h +++ b/include/mprops.h @@ -136,7 +136,7 @@ // int, 4 values - up button, down button, left button, right button #define MTRACK_PROP_HOLD1_MOVE3_BUTTONS "Trackpad Hold1Move3 Buttons" -// int, 4 values - enable, timeout, wait, dist +// int, 5 values - enable, timeout, wait, dist, lock timeout #define MTRACK_PROP_DRAG_SETTINGS "Trackpad Drag Settings" // int, 2 values - invert x axis, invert y axis #define MTRACK_PROP_AXIS_INVERT "Trackpad Axis Inversion" diff --git a/src/mconfig.c b/src/mconfig.c index 36d2ae0..d286c85 100644 --- a/src/mconfig.c +++ b/src/mconfig.c @@ -305,6 +305,8 @@ void mconfig_configure(struct MConfig* cfg, cfg->drag_timeout = MAXVAL(xf86SetIntOption(opts, "TapDragTime", DEFAULT_DRAG_TIMEOUT), 1); cfg->drag_wait = MAXVAL(xf86SetIntOption(opts, "TapDragWait", DEFAULT_DRAG_WAIT), 0); cfg->drag_dist = MAXVAL(xf86SetIntOption(opts, "TapDragDist", DEFAULT_DRAG_DIST), 0); + cfg->drag_lock_timeout = xf86SetIntOption(opts, "TapDragLockTimeout", DEFAULT_DRAG_LOCK_TIMEOUT); + cfg->axis_x_invert = xf86SetBoolOption(opts, "AxisXInvert", DEFAULT_AXIS_X_INVERT); cfg->axis_y_invert = xf86SetBoolOption(opts, "AxisYInvert", DEFAULT_AXIS_Y_INVERT); cfg->sensitivity = MAXVAL(xf86SetRealOption(opts, "Sensitivity", DEFAULT_SENSITIVITY), 0);