Do not show double tracking in debug and start

This commit is contained in:
Rico Tiongson 2019-02-12 22:22:29 +08:00
parent c45ceb3da3
commit f0ae3caab0
3 changed files with 4 additions and 5 deletions

View File

@ -86,7 +86,8 @@ namespace comfortable_swipe::gesture
float scale = this->previous_gesture == swipe_gesture::FRESH float scale = this->previous_gesture == swipe_gesture::FRESH
? 1.00f ? 1.00f
: 0.01f; // square root of 1/10 : 0.01f; // square root of 1/10
if (this->x * this->x + this->y * this->y > this->threshold_squared * scale) static const float EPSILON = 1e-6f;
if (this->x * this->x + this->y * this->y > this->threshold_squared * scale - EPSILON)
{ {
int mask = 0; int mask = 0;
if (this->fingers == 3) mask |= swipe_gesture::MSK_THREE_FINGERS; if (this->fingers == 3) mask |= swipe_gesture::MSK_THREE_FINGERS;

View File

@ -28,7 +28,7 @@ namespace comfortable_swipe::service
*/ */
void debug() void debug()
{ {
(void) std::system("stdbuf -oL -e0 libinput debug-events"); (void) std::system("bash -c \"stdbuf -oL -e0 libinput debug-events 2> >(grep -v 'double tracking')\"");
} }
} }

View File

@ -31,9 +31,7 @@ namespace comfortable_swipe::service
*/ */
void start() void start()
{ {
(void) std::system("stdbuf -oL -e0 libinput debug-events | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer " (void) std::system(__COMFORTABLE_SWIPE__PROGRAM__ " debug | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer");
// dont show double tracking bugs from libinput
"2> >(grep -v \"double tracking\")");
} }
} }