Skip to content

Commit

Permalink
fix: use exisiting methods for updating workspace swipe
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename committed Dec 17, 2023
1 parent a5e7ca8 commit b087bc7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/GestureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ void GestureManager::handleCancelledGesture() {
this->emulateSwipeEnd(0, false);
}

void GestureManager::dragGestureUpdate(const wf::touch::gesture_event_t& ev) {
// TODO:
emulateSwipeUpdate(ev.time);
}

bool GestureManager::handleWorkspaceSwipe(const DragGesture& gev) {
static auto* const PWORKSPACEFINGERS =
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:touch_gestures:workspace_swipe_fingers")->intValue;
Expand Down Expand Up @@ -233,6 +238,7 @@ bool GestureManager::onTouchUp(wlr_touch_up_event* ev) {

// NOTE this is neccessary because onTouchDown might fail and exit without
// updating gestures
// FIXME: I don't think the above is true anymore but haven't checked
wf::touch::point_t lift_off_pos;
try {
lift_off_pos = this->m_sGestureState.fingers.at(ev->touch_id).current;
Expand Down Expand Up @@ -260,10 +266,6 @@ bool GestureManager::onTouchMove(wlr_touch_motion_event* ev) {
if (g_pCompositor->m_sSeat.exclusiveClient) // lock screen, I think
return false;

if (this->dragGestureIsActive()) {
this->emulateSwipeUpdate(0);
}

auto pos = wlrTouchEventPositionAsPixels(ev->x, ev->y);

const wf::touch::gesture_event_t gesture_event = {
Expand Down

0 comments on commit b087bc7

Please sign in to comment.