~sircmpwn/casa

d0e40aaf09777f81281afa4ecbc8129e17d039eb — Drew DeVault 3 months ago 2234ef6
Lower gesture completion threshold 25%
1 files changed, 7 insertions(+), 5 deletions(-)

M src/surface.c
M src/surface.c => src/surface.c +7 -5
@@ 8,6 8,11 @@
#include "render.h"
#include "surface.h"

/* TODO: Move animation/state into its own file */
/* The minimum number of milliseconds an animation will complete in */
const int32_t anim_target_duration = 200;
const double gesture_completion_threshold = 0.25;

static void
wl_surface_enter(void *data,
		struct wl_surface *wl_surface,


@@ 165,9 170,6 @@ casa_surface_schedule_frame(struct casa_surface *surf)
	wl_surface_commit(surf->surface);
}

/* The minimum number of milliseconds an animation will complete in */
const int32_t anim_target_duration = 200;

static double
casa_surface_state_raw_progress(struct casa_surface *surf, int32_t time,
		struct casa_touchpoint *tp, double *raw)


@@ 256,7 258,7 @@ casa_surface_touch_up(struct casa_surface *surf,
	double raw;
	double progress = casa_surface_state_raw_progress(surf, time, tp, &raw);
	enum casa_surface_state next_state = surf->state;
	if (raw > 0.5) {
	if (raw > gesture_completion_threshold) {
		switch (surf->state) {
		case CASA_SURFACE_IDLE:
			next_state = CASA_SURFACE_BROWSE;


@@ 269,7 271,7 @@ casa_surface_touch_up(struct casa_surface *surf,

	if (progress >= 1.0) {
		surf->state = next_state;
	} else if (raw > 0.5) {
	} else if (raw > gesture_completion_threshold) {
		surf->anim_due = time +
			(int32_t)(anim_target_duration * (1.0 - progress));
		surf->next_state = next_state;