mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Scroll optimisations are now controlled by #ifdef OPTIMISE_SCROLL.
Scroll-bar manipulation now uses scroll optimisation more sensibly. [originally from svn r69]
This commit is contained in:
parent
23634d10df
commit
f4d6dbcc0e
4
putty.h
4
putty.h
@ -3,6 +3,10 @@
|
||||
|
||||
#define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
|
||||
|
||||
#ifdef macintosh
|
||||
#define OPTIMISE_SCROLL
|
||||
#endif
|
||||
|
||||
#ifdef macintosh
|
||||
#include <MacTypes.h>
|
||||
#include <Palettes.h>
|
||||
|
15
terminal.c
15
terminal.c
@ -398,9 +398,12 @@ static void scroll (int topline, int botline, int lines, int sb) {
|
||||
selend = scroll_top + size + scroll_size;
|
||||
}
|
||||
}
|
||||
#ifdef OPTIMISE_SCROLL
|
||||
scroll_display(topline, botline, lines);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef OPTIMISE_SCROLL
|
||||
static void scroll_display(int topline, int botline, int lines) {
|
||||
unsigned long *start, *end;
|
||||
int distance, size, i;
|
||||
@ -420,6 +423,7 @@ static void scroll_display(int topline, int botline, int lines) {
|
||||
}
|
||||
do_scroll(topline, botline, lines);
|
||||
}
|
||||
#endif /* OPTIMISE_SCROLL */
|
||||
|
||||
|
||||
/*
|
||||
@ -1292,6 +1296,10 @@ void term_paint (Context ctx, int l, int t, int r, int b) {
|
||||
*/
|
||||
void term_scroll (int rel, int where) {
|
||||
int n = where * (cols+1);
|
||||
#ifdef OPTIMISE_SCROLL
|
||||
unsigned long *olddisptop = disptop;
|
||||
int shift;
|
||||
#endif /* OPTIMISE_SCROLL */
|
||||
|
||||
disptop = (rel < 0 ? scrtop :
|
||||
rel > 0 ? sbtop : disptop) + n;
|
||||
@ -1300,8 +1308,11 @@ void term_scroll (int rel, int where) {
|
||||
if (disptop > scrtop)
|
||||
disptop = scrtop;
|
||||
update_sbar();
|
||||
if (rel == 0 && where < rows && where > -rows)
|
||||
scroll_display(0, rows - 1, where);
|
||||
#ifdef OPTIMISE_SCROLL
|
||||
shift = (disptop - olddisptop) / (cols + 1);
|
||||
if (shift < rows && shift > -rows)
|
||||
scroll_display(0, rows - 1, shift);
|
||||
#endif /* OPTIMISE_SCROLL */
|
||||
term_update();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user