chiark / gitweb /
Button zones: Provide BottomEdgeZonesEnable
[xf86-input-mtrack.git] / src / gestures.c
index 5922c00fcf175c9c51e6c169f24eb15242764bb4..22a94ac15e4271da5d57905261cda469bc3ccd3f 100644 (file)
@@ -215,6 +215,21 @@ static void buttons_update(struct Gestures* gs,
                        if (cfg->button_zones && earliest >= 0) {
                                pos = ms->touch[earliest].x;
                        }
+                       if (cfg->bottom_edge_zones) {
+                               int latest_bottom = -1;
+                               foreach_bit(i, ms->touch_used) {
+                                       if (!GETBIT(ms->touch[i].state, MT_BOTTOM_EDGE))
+                                               continue;
+                                       if (GETBIT(ms->touch[i].state, MT_PALM) && cfg->ignore_palm)
+                                               continue;
+                                       /* we deliberately don't ignore thumbs for bottom button zones */
+
+                                       if (latest_bottom == -1 || timercmp(&ms->touch[i].down, &ms->touch[latest_bottom].down, >))
+                                               latest_bottom = i;
+                               }
+                               if (latest_bottom >= 0)
+                                       pos = ms->touch[latest_bottom].x;
+                       }
 
                        if (pos >= 0) {
                                int zones, left, right;