Skip to content

Commit

Permalink
Remove move_speed variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
p2rkw committed Sep 27, 2015
1 parent 7219f7f commit eb119c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/gestures.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct Gestures {
int move_drag;
int move_drag_dx;
int move_drag_dy;
double move_speed;

struct timeval move_wait;
struct timeval move_drag_wait;
struct timeval move_drag_expire;
Expand Down
18 changes: 7 additions & 11 deletions src/gestures.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,9 @@ static void trigger_move(struct Gestures* gs,
gs->move_type = GS_MOVE;
gs->move_dist = 0;
gs->move_dir = TR_NONE;
//gs->move_speed = hypot(gs->move_dx, gs->move_dy)/timertomicro(&gs->dt);
timerclear(&gs->move_wait);
#ifdef DEBUG_GESTURES
xf86Msg(X_INFO, "trigger_move: %d, %d (speed %f)\n",
gs->move_dx, gs->move_dy, gs->move_speed);
xf86Msg(X_INFO, "trigger_move: %d, %d\n", gs->move_dx, gs->move_dy);
#endif
}
}
Expand Down Expand Up @@ -599,8 +597,8 @@ static int trigger_swipe_unsafe(struct Gestures* gs,
trigger_button_click(gs, button - 1, &tv_tmp);
}
#ifdef DEBUG_GESTURES
xf86Msg(X_INFO, "trigger_swipe_button: swiping %+f in direction %d (at %d of %d) (speed %f)\n",
dist, dir, gs->move_dist, cfg_swipe->dist, gs->move_speed);
xf86Msg(X_INFO, "trigger_swipe_button: swiping %+f in direction %d (at %d of %d)\n",
dist, dir, gs->move_dist, cfg_swipe->dist);
#endif
return 1;
}
Expand Down Expand Up @@ -812,7 +810,6 @@ static void trigger_scale(struct Gestures* gs,
gs->move_type = GS_SCALE;
gs->move_dist += (int)ABSVAL(dist);
gs->move_dir = dir;
//gs->move_speed = dist/timertomicro(&gs->dt);
timeraddms(&gs->time, cfg->gesture_wait, &gs->move_wait);
if (gs->move_dist >= cfg->scale_dist) {
gs->move_dist = MODVAL(gs->move_dist, cfg->scale_dist);
Expand All @@ -823,8 +820,8 @@ static void trigger_scale(struct Gestures* gs,
trigger_button_click(gs, cfg->scale_dn_btn - 1, &tv_tmp);
}
#ifdef DEBUG_GESTURES
xf86Msg(X_INFO, "trigger_scale: scaling %+f in direction %d (at %d of %d) (speed %f)\n",
dist, dir, gs->move_dist, cfg->scale_dist, gs->move_speed);
xf86Msg(X_INFO, "trigger_scale: scaling %+f in direction %d (at %d of %d)\n",
dist, dir, gs->move_dist, cfg->scale_dist);
#endif
}
}
Expand All @@ -843,7 +840,6 @@ static void trigger_rotate(struct Gestures* gs,
gs->move_type = GS_ROTATE;
gs->move_dist += (int)ABSVAL(dist);
gs->move_dir = dir;
//gs->move_speed = dist/timertomicro(&gs->dt);
timeraddms(&gs->time, cfg->gesture_wait, &gs->move_wait);
if (gs->move_dist >= cfg->rotate_dist) {
gs->move_dist = MODVAL(gs->move_dist, cfg->rotate_dist);
Expand All @@ -854,8 +850,8 @@ static void trigger_rotate(struct Gestures* gs,
trigger_button_click(gs, cfg->rotate_rt_btn - 1, &tv_tmp);
}
#ifdef DEBUG_GESTURES
xf86Msg(X_INFO, "trigger_rotate: rotating %+f in direction %d (at %d of %d) (speed %f)\n",
dist, dir, gs->move_dist, cfg->rotate_dist, gs->move_speed);
xf86Msg(X_INFO, "trigger_rotate: rotating %+f in direction %d (at %d of %d)\n",
dist, dir, gs->move_dist, cfg->rotate_dist);
#endif
}
}
Expand Down

0 comments on commit eb119c8

Please sign in to comment.