From: ayin Date: Mon, 31 Dec 2007 01:05:50 +0000 (+0000) Subject: Move last_{bot,top,state} from rxvt_term to scrollBar_t. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=d38e439780322966b82d7082ef2dc154ae62e31f;p=dana%2Furxvt.git Move last_{bot,top,state} from rxvt_term to scrollBar_t. --- diff --git a/src/init.C b/src/init.C index 579bdf68..c9d27a2e 100644 --- a/src/init.C +++ b/src/init.C @@ -299,7 +299,6 @@ rxvt_term::init_vars () refresh_type = SLOW_REFRESH; oldcursor.row = oldcursor.col = -1; - last_bot = last_state = -1; set_option (Opt_scrollBar); set_option (Opt_scrollTtyOutput); diff --git a/src/rxvt.h b/src/rxvt.h index 67471377..29224c8a 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1005,9 +1005,6 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen { mouse_slip_wheel_speed, #endif refresh_count, - last_bot, /* scrollbar last bottom position */ - last_top, /* scrollbar last top position */ - last_state, /* scrollbar last state */ window_vt_x, window_vt_y, window_sb_x, diff --git a/src/scrollbar.C b/src/scrollbar.C index 075d51b1..77f9f18f 100644 --- a/src/scrollbar.C +++ b/src/scrollbar.C @@ -164,17 +164,17 @@ rxvt_term::scrollbar_show (int update) scrollbar_minheight () + adj; scrollBar.bot = (scrollBar.top + scrollbar_len); /* no change */ - if (scrollBar.top == last_top - && scrollBar.bot == last_bot - && (scrollBar.state == last_state || !scrollbar_isUpDn ())) + if (scrollBar.top == scrollBar.last_top + && scrollBar.bot == scrollBar.last_bot + && (scrollBar.state == scrollBar.last_state || !scrollbar_isUpDn ())) return 0; } - ret = (this->*scrollBar.update) (update, last_top, last_bot, scrollbar_len); + ret = (this->*scrollBar.update) (update, scrollBar.last_top, scrollBar.last_bot, scrollbar_len); - last_top = scrollBar.top; - last_bot = scrollBar.bot; - last_state = scrollBar.state; + scrollBar.last_top = scrollBar.top; + scrollBar.last_bot = scrollBar.bot; + scrollBar.last_state = scrollBar.state; #endif return ret; @@ -246,6 +246,7 @@ rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, co else if (strncasecmp (scrollalign, "bottom", 6) == 0) scrollBar.align = R_SB_ALIGN_BOTTOM; } + scrollBar.last_bot = scrollBar.last_state = -1; #endif } diff --git a/src/scrollbar.h b/src/scrollbar.h index 87e3f92e..fc483589 100644 --- a/src/scrollbar.h +++ b/src/scrollbar.h @@ -15,6 +15,9 @@ typedef struct { unsigned int style; /* style: rxvt, xterm, next */ unsigned int width; /* scrollbar width */ int shadow; /* scrollbar shadow width */ + int last_bot; /* scrollbar last bottom position */ + int last_top; /* scrollbar last top position */ + int last_state; /* scrollbar last state */ unsigned char align; Window win; int (rxvt_term::*update)(int, int, int, int);