Move last_{bot,top,state} from rxvt_term to scrollBar_t.
authorayin <ayin>
Mon, 31 Dec 2007 01:05:50 +0000 (01:05 +0000)
committerayin <ayin>
Mon, 31 Dec 2007 01:05:50 +0000 (01:05 +0000)
src/init.C
src/rxvt.h
src/scrollbar.C
src/scrollbar.h

index 579bdf682551fcba2896ae74834af06afa502fe6..c9d27a2ebaed0fb48b8584420a867bdc8be8b678 100644 (file)
@@ -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);
index 67471377b6054be8ec62d269b307843a217de330..29224c8a7466f2a70c29fde9d3a5c805cc10dcd2 100644 (file)
@@ -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,
index 075d51b1c99910843e3b89d3bdbc92e48640ef3a..77f9f18f3c6a47725cbc50e4215fa729cbfe4918 100644 (file)
@@ -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
 }
 
index 87e3f92ee541ecdbeecc5618ae279d42cc6466b7..fc483589bc851da99cc883fc824faef1d2916a12 100644 (file)
@@ -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);