Add remaining momentum scroll phases to switch statement
According to https://developer.apple.com/documentation/appkit/nsevent/1533550-phase the momentum phase may end with "cancelled" instead of "ended"
This commit is contained in:
parent
2f677990b2
commit
e0246044b7
@ -575,16 +575,21 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags) {
|
|||||||
enum MomentumData momentum_data = (flags >> 1) & 7;
|
enum MomentumData momentum_data = (flags >> 1) & 7;
|
||||||
|
|
||||||
switch(momentum_data) {
|
switch(momentum_data) {
|
||||||
|
case NoMomentumData:
|
||||||
|
break;
|
||||||
case MomentumPhaseBegan:
|
case MomentumPhaseBegan:
|
||||||
window_for_momentum_scroll = w->id;
|
window_for_momentum_scroll = w->id;
|
||||||
main_screen_for_momentum_scroll = screen->linebuf == screen->main_linebuf;
|
main_screen_for_momentum_scroll = screen->linebuf == screen->main_linebuf;
|
||||||
break;
|
break;
|
||||||
|
case MomentumPhaseStationary:
|
||||||
case MomentumPhaseActive:
|
case MomentumPhaseActive:
|
||||||
if (window_for_momentum_scroll != w->id || main_screen_for_momentum_scroll != (screen->linebuf == screen->main_linebuf)) return;
|
if (window_for_momentum_scroll != w->id || main_screen_for_momentum_scroll != (screen->linebuf == screen->main_linebuf)) return;
|
||||||
break;
|
break;
|
||||||
case MomentumPhaseEnded:
|
case MomentumPhaseEnded:
|
||||||
|
case MomentumPhaseCancelled:
|
||||||
window_for_momentum_scroll = 0;
|
window_for_momentum_scroll = 0;
|
||||||
break;
|
break;
|
||||||
|
case MomentumPhaseMayBegin:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user