Skip to content

Commit 28f5ca2

Browse files
committed
Optimize swipe function
1 parent 89b79bc commit 28f5ca2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/gesture/swipe_gesture.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ namespace comfortable_swipe::gesture
5050
):
5151
comfortable_swipe::gesture::xdo_gesture(),
5252
threshold_squared(threshold*threshold),
53-
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4})
53+
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4}),
54+
flag_swiping(false)
5455
{
5556
// improve responsiveness of first gesture by pre-empting xdotool runtime
5657
xdo_get_mouse_location(this->xdo, &this->ix, &this->iy, &this->screen_num);

lib/service/buffer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121

2222
#include <cstdio> // fgets_unlocked, stdin
23+
#include <iostream> // std::ios, std::cout, std::cin
2324
#include "../index.hpp"
2425

2526
/**
@@ -29,6 +30,11 @@ namespace comfortable_swipe::service
2930
{
3031
void buffer()
3132
{
33+
std::ios::sync_with_stdio(false);
34+
std::cin.tie(0);
35+
std::cout.tie(0);
36+
std::cout.flush();
37+
3238
// read config file
3339
auto config = comfortable_swipe::util::read_config_file(comfortable_swipe::util::conf_filename());
3440

0 commit comments

Comments
 (0)