Skip to content

Commit b1f8a7c

Browse files
authored
Remove irrelevant double tracking bug in error log (#53)
* Do not show double tracking * Do not show double tracking in debug and start
1 parent 1c9b497 commit b1f8a7c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/gesture/swipe_gesture.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ namespace comfortable_swipe::gesture
8686
float scale = this->previous_gesture == swipe_gesture::FRESH
8787
? 1.00f
8888
: 0.01f; // square root of 1/10
89-
if (this->x * this->x + this->y * this->y > this->threshold_squared * scale)
89+
static const float EPSILON = 1e-6f;
90+
if (this->x * this->x + this->y * this->y > this->threshold_squared * scale - EPSILON)
9091
{
9192
int mask = 0;
9293
if (this->fingers == 3) mask |= swipe_gesture::MSK_THREE_FINGERS;

lib/service/debug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace comfortable_swipe::service
2828
*/
2929
void debug()
3030
{
31-
(void) std::system("stdbuf -oL -e0 libinput debug-events");
31+
(void) std::system("bash -c \"stdbuf -oL -e0 libinput debug-events 2> >(grep -v 'double tracking')\"");
3232
}
3333
}
3434

lib/service/start.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace comfortable_swipe::service
3131
*/
3232
void start()
3333
{
34-
(void) std::system("stdbuf -oL -e0 libinput debug-events | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer");
34+
(void) std::system(__COMFORTABLE_SWIPE__PROGRAM__ " debug | " __COMFORTABLE_SWIPE__PROGRAM__ " buffer");
3535
}
3636
}
3737

0 commit comments

Comments
 (0)