Add more momentum scroll phases

This commit is contained in:
Luflosi
2018-12-27 15:12:57 +01:00
parent d0da418e49
commit 7652065134
3 changed files with 18 additions and 9 deletions

View File

@@ -572,17 +572,18 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags) {
int s;
bool is_high_resolution = flags & 1;
Screen *screen = w->render_data.screen;
enum MomentumData { NoMomentumData, StartMomentumPhase, MomentumPhaseActive, MomentumPhaseEnded };
enum MomentumData momentum_data = (flags >> 1) & 3;
enum MomentumData { NoMomentumData, MomentumPhaseBegan, MomentumPhaseStationary, MomentumPhaseActive, MomentumPhaseEnded, MomentumPhaseCancelled, MomentumPhaseMayBegin };
enum MomentumData momentum_data = (flags >> 1) & 7;
switch(momentum_data) {
case StartMomentumPhase:
case MomentumPhaseBegan:
window_for_momentum_scroll = w->id; break;
case MomentumPhaseActive:
if (window_for_momentum_scroll != w->id) return;
break;
case MomentumPhaseEnded:
window_for_momentum_scroll = 0; break;
case NoMomentumData:
default:
break;
}
if (is_high_resolution) {