Skip to content

Commit

Permalink
Small documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
noah-nuebling committed May 5, 2020
1 parent 7cf2b94 commit 4c4d42e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Mouse Fix Helper/Scroll/ScrollControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -223,7 +223,7 @@ static CGEventRef eventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEv
}
}

// Process event
// Process event

if (_isSmoothEnabled) {
[SmoothScroll handleInput:eventCopy info:NULL];
Expand Down
4 changes: 2 additions & 2 deletions Mouse Fix Helper/Scroll/SmoothScroll.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 4c4d42e

Please sign in to comment.