Skip to content

Commit

Permalink
Moved SetScrollValuator calls after props_init, added 2 more valuator…
Browse files Browse the repository at this point in the history
…s calls.
  • Loading branch information
p2rkw committed Sep 27, 2015
1 parent 6947fc2 commit 7219f7f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
17 changes: 10 additions & 7 deletions driver/mprops.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop
uint32_t* ivals32;
float* fvals;

int error_code;
int error_code;

if (property == mprops.trackpad_disable) {
if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
Expand Down Expand Up @@ -542,12 +542,6 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop
else if (set_swipe_properties(property, checkonly, prop, &mprops.scroll, &cfg->scroll, &error_code)) {
return error_code;
}
else if (set_swipe_properties(property, checkonly, prop, &mprops.swipe3, &cfg->swipe3, &error_code)) {
return error_code;
}
else if (set_swipe_properties(property, checkonly, prop, &mprops.swipe4, &cfg->swipe4, &error_code)) {
return error_code;
}
else if (property == mprops.scroll_coast) {
if (prop->size != 2 || prop->type != mprops.float_type)
return BadMatch;
Expand Down Expand Up @@ -581,6 +575,12 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop
#endif
}
}
else if (set_swipe_properties(property, checkonly, prop, &mprops.swipe3, &cfg->swipe3, &error_code)) {
return error_code;
}
else if (set_swipe_properties(property, checkonly, prop, &mprops.swipe4, &cfg->swipe4, &error_code)) {
return error_code;
}
else if (property == mprops.scale_buttons) {
if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
Expand Down Expand Up @@ -746,6 +746,9 @@ int mprops_set_property(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop
}
}

SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, cfg->scroll.dist, 0);
SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, cfg->scroll.dist, 0);

return Success;
}

2 changes: 1 addition & 1 deletion driver/mtrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
1, 0, 1);
#endif
xf86InitValuatorDefaults(dev, 1);
mprops_init(&mt->cfg, local);
SetScrollValuator(dev, 2, SCROLL_TYPE_HORIZONTAL, mt->cfg.scroll.dist, 0);
SetScrollValuator(dev, 3, SCROLL_TYPE_VERTICAL, mt->cfg.scroll.dist, 0);
mprops_init(&mt->cfg, local);
XIRegisterPropertyHandler(dev, mprops_set_property, NULL, NULL);

TimerInit();
Expand Down
7 changes: 5 additions & 2 deletions include/mprops.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@
// int, 2 value - button hold, wait time
#define MTRACK_PROP_GESTURE_SETTINGS "Trackpad Gesture Settings"
// int, 1 value - enable high precision scrolling
#define MTRACK_PROP_SMOOTH_SCROLL "Trackpad High Smooth Scroll"
// int, 2 values
#define MTRACK_PROP_SMOOTH_SCROLL "Trackpad Smooth Scroll"
// int, 3 values
// first: distance before a scroll event (two finger swipe) is triggered
// second: how much milliseconds button will be hold after {up,down,left,right} scroll
// third: sensitivity of the pointer during scroll gesture multiplied by 1000, value of 0 disables drag-to-move
#define MTRACK_PROP_SCROLL_SETTINGS "Trackpad Scroll Settings"
// int, 4 values - up button, down button, left button, right button
#define MTRACK_PROP_SCROLL_BUTTONS "Trackpad Scroll Buttons"
Expand All @@ -75,12 +76,14 @@
// int, 2 values
// first: distance before a three finger swipe event is triggered
// second: how much milliseconds button will be hold after {up,down,left,right} swipe
// third: sensitivity of the pointer during three finger swipe gesture multiplied by 1000, value of 0 disables drag-to-move
#define MTRACK_PROP_SWIPE_SETTINGS "Trackpad Swipe Settings"
// int, 4 values - up button, down button, left button, right button
#define MTRACK_PROP_SWIPE_BUTTONS "Trackpad Swipe Buttons"
// int, 2 values
// first: distance before a four finger swipe event is triggered
// second: how much milliseconds button will be hold after {up,down,left,right} swipe4
// third: sensitivity of the pointer during four finger swipe gesture multiplied by 1000, value of 0 disables drag-to-move
#define MTRACK_PROP_SWIPE4_SETTINGS "Trackpad Swipe4 Settings"
// int, 4 values - up button, down button, left button, right button
#define MTRACK_PROP_SWIPE4_BUTTONS "Trackpad Swipe4 Buttons"
Expand Down

0 comments on commit 7219f7f

Please sign in to comment.