From 4c4d42e29d87034598b1e2be4cc48c9e2165485c Mon Sep 17 00:00:00 2001 From: noah-gk Date: Tue, 5 May 2020 09:01:07 +0200 Subject: [PATCH] Small documentation improvements --- Mouse Fix Helper/Scroll/ScrollControl.m | 8 ++++---- Mouse Fix Helper/Scroll/SmoothScroll.m | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mouse Fix Helper/Scroll/ScrollControl.m b/Mouse Fix Helper/Scroll/ScrollControl.m index 2fecede4d..5cccae73e 100644 --- a/Mouse Fix Helper/Scroll/ScrollControl.m +++ b/Mouse Fix Helper/Scroll/ScrollControl.m @@ -194,10 +194,10 @@ static CGEventRef eventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEv CGEventRef eventCopy = [ScrollUtility createScrollEventWithValuesFromEvent:event]; // Do heavy processing of event on a different thread using `dispatch_async`, so we can return faster - // Returning fast should prevent the system from disabling this eventTap entirely when under load + // Returning fast should prevent the system from disabling this eventTap entirely when under load. This doesn't happen in MOS for some reason, maybe there's a better solution than multithreading. + // With multithreading enabled, scrolling sometimes - seemingly at random - stops working entirely. So the tap still works but sending events doesn't. + // - Switching to an app that doesn't have smothscroll enabled seems to fix it. -> Somethings in my code must be breaking dispatch_async(_scrollQueue, ^{ - - // Check if scrolling direction changed @@ -223,7 +223,7 @@ static CGEventRef eventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEv } } - // Process event + // Process event if (_isSmoothEnabled) { [SmoothScroll handleInput:eventCopy info:NULL]; diff --git a/Mouse Fix Helper/Scroll/SmoothScroll.m b/Mouse Fix Helper/Scroll/SmoothScroll.m index 734ba7e20..61c551210 100644 --- a/Mouse Fix Helper/Scroll/SmoothScroll.m +++ b/Mouse Fix Helper/Scroll/SmoothScroll.m @@ -68,7 +68,7 @@ + (void)load_Manual { /// Consider calling [ScrollControl resetDynamicGlobals] to reset not only SmoothScroll specific globals. + (void)resetDynamicGlobals { - _displayLinkPhase = kMFPhaseNone; + _displayLinkPhase = kMFPhaseStart; // kMFPhaseNone; _pxToScrollThisFrame = 0; _pxScrollBuffer = 0; _msLeftForScroll = 0; @@ -134,7 +134,7 @@ + (void)handleInput:(CGEventRef)event info:(NSDictionary * _Nullable)info { NSLog(@"Error while trying to set display link to display under mouse pointer: %@", [e reason]); } } - if (CVDisplayLinkIsRunning(_displayLink) == FALSE) { // Do this after setting app overrides, because that might reroute the event. Rerouting might lead to this event being processed by RoughScroll.m instead of Smoothscroll.m (If the override turns smooth scrolling off). In that case we don't want to start the displayLink. + if (CVDisplayLinkIsRunning(_displayLink) == FALSE) { CVDisplayLinkStart(_displayLink); } }