Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 27, 2018
1 parent 7b2ecb0 commit 77e72cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions kitty/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +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;
int momentum_data = (flags >> 1) & 3;
enum MomentumData { NoMomentumData, StartMomentumPhase, MomentumPhaseActive, MomentumPhaseEnded };
enum MomentumData momentum_data = (flags >> 1) & 3;
switch(momentum_data) {
case 1:
case StartMomentumPhase:
window_for_momentum_scroll = w->id; break;
case 2:
case MomentumPhaseActive:
if (window_for_momentum_scroll != w->id) return;
break;
case 3:
case MomentumPhaseEnded:
window_for_momentum_scroll = 0; break;
default:
break;
case NoMomentumData:
break;
}
if (is_high_resolution) {
Expand Down

0 comments on commit 77e72cf

Please sign in to comment.