mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 08:18:08 +02:00
Add more momentum scroll phases
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user