Skip to content
Snippets Groups Projects
Commit e33238a1 authored by George Nachman's avatar George Nachman
Browse files

Detect user scroll when live scrolls occur.

A live scroll happens when you drag the scroller. It does not happen when you use the scroll wheel or keyboard shortcuts.

This fixes a bug where the GCD refresh timer fires during live scroll causing the screen to jump to the bottom. It wasn't an issue with NSTimer since the screen was never asked to redraw during live scroll because of the runloop mode.

See the thread on iterm2-discuss with the subject line: OSX 10.12.4 iTerm 3.1 beta 3 scrolling strange behavior..
parent 725b65dc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -114,12 +114,14 @@
[aScroller release];
 
creationDate_ = [[NSDate date] retain];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(it_scrollViewDidScroll:) name:NSScrollViewDidLiveScrollNotification object:self];
}
return self;
}
 
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[creationDate_ release];
[timer_ invalidate];
timer_ = nil;
Loading
Loading
@@ -136,6 +138,10 @@
return (PTYScroller *)[super verticalScroller];
}
 
- (void)it_scrollViewDidScroll:(id)sender {
[self detectUserScroll];
}
static CGFloat RoundTowardZero(CGFloat value) {
if (value > 0) {
return floor(value);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment