summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-03 10:50:50 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-04-05 10:43:15 +1000
commitac47b4ea5b4f7b920b84a1e70adce3475e3be346 (patch)
tree9112a0bfe48e73cfb454956eeda60148e78c2bef
parent368d96f4dfd4605b80d039ec4508c906c3723cf7 (diff)
Allow soft button areas to overlap on the edge
For percent-based configuration in the form of middle button 33%-66%, right button 66%-0 we'd get an error because of the one device unit overlap. This was neither documented nor useful, because leaving a 1% gap leaves an actual gap between the buttons. Allow for an overlap of one device unit on the edge of the buttons. What's picked in that case depends on the implementation of is_inside_softbutton_area but since one device unit is so small, it doesn't matter. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--man/synaptics.man3
-rw-r--r--src/synaptics.c16
2 files changed, 10 insertions, 9 deletions
diff --git a/man/synaptics.man b/man/synaptics.man
index 2b7b7b9..079a5f8 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -443,7 +443,8 @@ bottom edge of the middle button, respectively. Any of the values may be
given as percentage of the touchpad width or height, whichever applies.
If any edge is set to 0 (not 0%), the button is assumed to extend to
infinity in the given direction. Setting all values to 0 (not 0%) disables
-soft button areas.
+soft button areas. Button areas may not overlap, however it is permitted for two
+buttons to share an edge value.
Property: "Synaptics Soft Button Areas"
.
diff --git a/src/synaptics.c b/src/synaptics.c
index 3437d9d..f0a8269 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -421,13 +421,13 @@ SynapticsIsSoftButtonAreasValid(int *values)
if ((right_bottom <= middle_bottom && right_bottom >= middle_top) ||
(right_top <= middle_bottom && right_top >= middle_top)) {
/* Check for overlapping left edges */
- if ((right_left < middle_left && right_right >= middle_left) ||
- (middle_left < right_left && middle_right >= right_left))
+ if ((right_left < middle_left && right_right > middle_left) ||
+ (middle_left < right_left && middle_right > right_left))
return FALSE;
/* Check for overlapping right edges */
- if ((right_right > middle_right && right_left <= middle_right) ||
- (middle_right > right_right && middle_left <= right_right))
+ if ((right_right > middle_right && right_left < middle_right) ||
+ (middle_right > right_right && middle_left < right_right))
return FALSE;
}
@@ -435,13 +435,13 @@ SynapticsIsSoftButtonAreasValid(int *values)
if ((right_left >= middle_left && right_left <= middle_right) ||
(right_right >= middle_left && right_right <= middle_right)) {
/* Check for overlapping top edges */
- if ((right_top < middle_top && right_bottom >= middle_top) ||
- (middle_top < right_top && middle_bottom >= right_top))
+ if ((right_top < middle_top && right_bottom > middle_top) ||
+ (middle_top < right_top && middle_bottom > right_top))
return FALSE;
/* Check for overlapping bottom edges */
- if ((right_bottom > middle_bottom && right_top <= middle_bottom) ||
- (middle_bottom > right_bottom && middle_top <= right_bottom))
+ if ((right_bottom > middle_bottom && right_top < middle_bottom) ||
+ (middle_bottom > right_bottom && middle_top < right_bottom))
return FALSE;
}
}