chiark / gitweb /
Offsets: Use xmin offset for button zones
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Apr 2016 22:20:15 +0000 (23:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Apr 2016 19:42:32 +0000 (20:42 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gestures.c

index b49ca6e..867ed81 100644 (file)
@@ -239,6 +239,8 @@ static void buttons_update(struct Gestures* gs,
                                int zones, left, right;
                                double width;
 
+                               pos -= cfg->pad_xmin;
+
                                zones = 0;
                                if (cfg->button_1touch > 0)
                                        zones++;
@@ -250,8 +252,8 @@ static void buttons_update(struct Gestures* gs,
                                if (zones > 0) {
                                        width = ((double)cfg->pad_width)/((double)zones);
 #ifdef DEBUG_GESTURES
-                                       xf86Msg(X_INFO, "buttons_update: pad width %d, zones %d, zone width %f, x %d\n",
-                                               cfg->pad_width, zones, width, pos);
+                                       xf86Msg(X_INFO, "buttons_update: pad width %d (min %d), zones %d, zone width %f, x %d\n",
+                                               cfg->pad_width, cfg->pad_xmin, zones, width, pos);
 #endif
                                        for (i = 0; i < zones; i++) {
                                                left = width*i;