--- old/src/macosx/native/sun/awt/LWCToolkit.m 2016-10-03 20:11:16.000000000 +0400 +++ new/src/macosx/native/sun/awt/LWCToolkit.m 2016-10-03 20:11:16.000000000 +0400 @@ -39,6 +39,13 @@ #import "sizecalc.h" +// SCROLL PHASE STATE +#define SCROLL_PHASE_UNSUPPORTED 1 +#define SCROLL_PHASE_BEGAN 2 +#define SCROLL_PHASE_CONTINUED 3 +#define SCROLL_PHASE_CANCELLED 4 +#define SCROLL_PHASE_ENDED 5 + int gNumberOfButtons; jint* gButtonDownMasks; @@ -54,6 +61,23 @@ eventCount++; } ++ (jint) scrollStateWithEvent: (NSEvent*) event { + + if ([event type] != NSScrollWheel) { + return 0; + } + + NSEventPhase phase = [event phase]; + NSEventPhase momentumPhase = [event momentumPhase]; + + if (!phase && !momentumPhase) return SCROLL_PHASE_UNSUPPORTED; + switch (phase) { + case NSEventPhaseBegan: return SCROLL_PHASE_BEGAN; + case NSEventPhaseCancelled: return SCROLL_PHASE_CANCELLED; + case NSEventPhaseEnded: return SCROLL_PHASE_ENDED; + } + return SCROLL_PHASE_CONTINUED; +} @end