Optimize swipe function

This commit is contained in:
Rico Tiongson 2019-03-03 22:00:48 +08:00
parent 89b79bc9bc
commit 28f5ca2a91
2 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,8 @@ namespace comfortable_swipe::gesture
):
comfortable_swipe::gesture::xdo_gesture(),
threshold_squared(threshold*threshold),
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4})
commands(new const char*[8]{left3, left4, right3, right4, up3, up4, down3, down4}),
flag_swiping(false)
{
// improve responsiveness of first gesture by pre-empting xdotool runtime
xdo_get_mouse_location(this->xdo, &this->ix, &this->iy, &this->screen_num);

View File

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdio> // fgets_unlocked, stdin
#include <iostream> // std::ios, std::cout, std::cin
#include "../index.hpp"
/**
@ -29,6 +30,11 @@ namespace comfortable_swipe::service
{
void buffer()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
std::cout.flush();
// read config file
auto config = comfortable_swipe::util::read_config_file(comfortable_swipe::util::conf_filename());