[PATCH xinput] Print an error if mode is neither ABSOLUTE nor RELATIVE.
Peter Hutterer
peter.hutterer at who-t.net
Sun Oct 10 20:49:12 PDT 2010
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
guess what: "Absolute", "absolute", "abs" and 1 all counted as relative. Oh
how we laughed.
src/setmode.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/setmode.c b/src/setmode.c
index 4bac6df..6812fdf 100644
--- a/src/setmode.c
+++ b/src/setmode.c
@@ -49,8 +49,11 @@ set_mode(Display *display,
if (strcmp(argv[1], "ABSOLUTE") == 0) {
mode = Absolute;
- } else {
+ } else if (strcmp(argv[1], "RELATIVE") == 0) {
mode = Relative;
+ } else {
+ fprintf(stderr, "Invalid mode, use ABSOLUTE or RELATIVE.\n");
+ return EXIT_FAILURE;
}
device = XOpenDevice(display, info->id);
--
1.7.2.3
More information about the xorg-devel
mailing list