-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
touch: make EDGE_SWIPE_THRESHOLD configurable #2517
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,7 +309,6 @@ void wf::touch_interface_t::update_cursor_state() | |
} | ||
|
||
// Swipe params | ||
constexpr static int EDGE_SWIPE_THRESHOLD = 10; | ||
constexpr static double MIN_SWIPE_DISTANCE = 30; | ||
constexpr static double MAX_SWIPE_DISTANCE = 450; | ||
constexpr static double SWIPE_INCORRECT_DRAG_TOLERANCE = 150; | ||
|
@@ -427,24 +426,25 @@ static uint32_t find_swipe_edges(wf::touch::point_t point) | |
{ | ||
auto output = wf::get_core().seat->get_active_output(); | ||
auto geometry = output->get_layout_geometry(); | ||
wf::option_wrapper_t<int> edge_swipe_threshold{"input/edge_swipe_threshold"}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will cause a lookup for the option every time the function is called. I would make it a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, will fix up after new year. |
||
|
||
uint32_t edge_directions = 0; | ||
if (point.x <= geometry.x + EDGE_SWIPE_THRESHOLD) | ||
if (point.x <= geometry.x + edge_swipe_threshold) | ||
{ | ||
edge_directions |= wf::GESTURE_DIRECTION_RIGHT; | ||
} | ||
|
||
if (point.x >= geometry.x + geometry.width - EDGE_SWIPE_THRESHOLD) | ||
if (point.x >= geometry.x + geometry.width - edge_swipe_threshold) | ||
{ | ||
edge_directions |= wf::GESTURE_DIRECTION_LEFT; | ||
} | ||
|
||
if (point.y <= geometry.y + EDGE_SWIPE_THRESHOLD) | ||
if (point.y <= geometry.y + edge_swipe_threshold) | ||
{ | ||
edge_directions |= wf::GESTURE_DIRECTION_DOWN; | ||
} | ||
|
||
if (point.y >= geometry.y + geometry.height - EDGE_SWIPE_THRESHOLD) | ||
if (point.y >= geometry.y + geometry.height - edge_swipe_threshold) | ||
{ | ||
edge_directions |= wf::GESTURE_DIRECTION_UP; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this 1 or so .. let the users have more freedom :)