summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-08-01 07:45:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-08-01 07:47:46 +1000
commit761687e9957cd870dfc8de3e19fb8fb9b7ff3e4e (patch)
treeaed418f30cc89fad38f37d2f0ec64f271ef80ad7 /tools
parent911106230a311a3ac894a91d46cdeb755d898fc2 (diff)
tools: require a minimum size for touchpads
This mostly aims to catch users trying to specify the size in inches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/touchpad-edge-detector.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/touchpad-edge-detector.c b/tools/touchpad-edge-detector.c
index 1cf4d5d..e09f028 100644
--- a/tools/touchpad-edge-detector.c
+++ b/tools/touchpad-edge-detector.c
@@ -240,6 +240,14 @@ int main (int argc, char **argv) {
size.w <= 0 || size.h <= 0)
return usage();
+ if (size.w < 30 || size.h < 30) {
+ fprintf(stderr,
+ "%dx%dmm is too small for a touchpad.\n"
+ "Please specify the touchpad size in mm.\n",
+ size.w, size.h);
+ return 1;
+ }
+
path = argv[2];
if (path[0] == '-')
return usage();