diff --git a/power-common.c b/power-common.c index 604c551..533df83 100644 --- a/power-common.c +++ b/power-common.c @@ -66,6 +66,7 @@ void power_init() { void process_interaction_hint(void* data) { static struct timespec s_previous_boost_timespec; + static int s_previous_duration = 0; static int prev_interaction_handle = -1; struct timespec cur_boost_timespec; @@ -89,7 +90,12 @@ void process_interaction_hint(void* data) { if (elapsed_time < 250000 && duration <= kMinInteractiveDuration) { return; } + // also don't hint if previous hint's duration covers this hint's duration + if ((s_previous_duration * 1000) > (elapsed_time + duration * 1000)) { + return; + } s_previous_boost_timespec = cur_boost_timespec; + s_previous_duration = duration; int interaction_handle = perf_hint_enable_with_type(VENDOR_HINT_SCROLL_BOOST, duration, SCROLL_VERTICAL);