This commit is contained in:
Kovid Goyal 2018-12-27 08:05:31 +05:30
parent 7b2ecb0498
commit 77e72cfd9a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

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