Always compile in plain style scrollbar.
authorayin <ayin>
Sun, 27 Jan 2008 22:48:31 +0000 (22:48 +0000)
committerayin <ayin>
Sun, 27 Jan 2008 22:48:31 +0000 (22:48 +0000)
12 files changed:
configure
configure.ac
doc/rxvt.7.pod
src/background.C
src/init.C
src/main.C
src/rsinc.h
src/rxvt.h
src/rxvtperl.xs
src/screen.C
src/scrollbar.C
src/xdefaults.C

index 9d4e5d3..4a838f1 100755 (executable)
--- a/configure
+++ b/configure
@@ -1307,7 +1307,6 @@ Optional Features:
   --enable-rxvt-scroll    enable rxvt style scrollbar
   --enable-next-scroll    enable NeXT style scrollbar
   --enable-xterm-scroll   enable Xterm style scrollbar
-  --enable-plain-scroll   enable plain style scrollbar
   --enable-perl           enable embedded perl interpreter
   --enable-xim            XIM (X Input Method) protocol support
   --disable-backspace-key disable handling of the backspace key
@@ -4380,7 +4379,6 @@ support_pointer_blank=yes
 support_scroll_rxvt=yes
 support_scroll_next=yes
 support_scroll_xterm=yes
-support_scroll_plain=yes
 support_xim=yes
 support_afterimage=yes
 support_afterstep=yes
@@ -4411,7 +4409,6 @@ if test "${enable_everything+set}" = set; then
        support_scroll_rxvt=no
        support_scroll_next=no
        support_scroll_xterm=no
-       support_scroll_plain=no
        support_utmp=no
        support_wtmp=no
        support_xim=no
@@ -4440,7 +4437,6 @@ if test "${enable_everything+set}" = set; then
        support_scroll_rxvt=yes
        support_scroll_next=yes
        support_scroll_xterm=yes
-       support_scroll_plain=yes
        support_utmp=yes
        support_wtmp=yes
        support_xim=yes
@@ -4607,14 +4603,6 @@ if test "${enable_xterm_scroll+set}" = set; then
 fi
 
 
-# Check whether --enable-plain-scroll was given.
-if test "${enable_plain_scroll+set}" = set; then
-  enableval=$enable_plain_scroll; if test x$enableval = xyes -o x$enableval = xno; then
-    support_scroll_plain=$enableval
-  fi
-fi
-
-
 # Check whether --enable-perl was given.
 if test "${enable_perl+set}" = set; then
   enableval=$enable_perl; if test x$enableval = xyes -o x$enableval = xno; then
@@ -11540,13 +11528,20 @@ _ACEOF
 fi
 
 
+scrolltypes=plain
+
+cat >>confdefs.h <<\_ACEOF
+#define PLAIN_SCROLLBAR 1
+_ACEOF
+
+
 if test x$support_scroll_rxvt = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define RXVT_SCROLLBAR 1
 _ACEOF
 
-  scrolltypes="rxvt"
+  scrolltypes="$scrolltypes rxvt"
 fi
 if test x$support_scroll_next = xyes; then
 
@@ -11564,14 +11559,6 @@ _ACEOF
 
   scrolltypes="$scrolltypes xterm"
 fi
-if test x$support_scroll_plain = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define PLAIN_SCROLLBAR 1
-_ACEOF
-
-  scrolltypes="$scrolltypes plain"
-fi
 if test x$support_pointer_blank = xyes; then
 
 cat >>confdefs.h <<\_ACEOF
index e2acfaf..050cd30 100644 (file)
@@ -94,7 +94,6 @@ support_pointer_blank=yes
 support_scroll_rxvt=yes
 support_scroll_next=yes
 support_scroll_xterm=yes
-support_scroll_plain=yes
 support_xim=yes
 support_afterimage=yes
 support_afterstep=yes
@@ -129,7 +128,6 @@ AC_ARG_ENABLE(everything,
        support_scroll_rxvt=no
        support_scroll_next=no
        support_scroll_xterm=no
-       support_scroll_plain=no
        support_utmp=no
        support_wtmp=no
        support_xim=no
@@ -158,7 +156,6 @@ AC_ARG_ENABLE(everything,
        support_scroll_rxvt=yes
        support_scroll_next=yes
        support_scroll_xterm=yes
-       support_scroll_plain=yes
        support_utmp=yes
        support_wtmp=yes
        support_xim=yes
@@ -263,12 +260,6 @@ AC_ARG_ENABLE(xterm-scroll,
     support_scroll_xterm=$enableval
   fi])
 
-AC_ARG_ENABLE(plain-scroll,
-  [  --enable-plain-scroll   enable plain style scrollbar],
-  [if test x$enableval = xyes -o x$enableval = xno; then
-    support_scroll_plain=$enableval
-  fi])
-
 AC_ARG_ENABLE(perl,
   [  --enable-perl           enable embedded perl interpreter],
   [if test x$enableval = xyes -o x$enableval = xno; then
@@ -648,9 +639,12 @@ dnl if test x$support_afterstep = xyes; then
 dnl   AC_DEFINE(AFTERSTEP_INTEGRATION, 1, Define if you want to integrate with AfterStep window manager)
 dnl fi
 
+scrolltypes=plain
+AC_DEFINE(PLAIN_SCROLLBAR, 1, Support plain style scrollbars)
+
 if test x$support_scroll_rxvt = xyes; then
   AC_DEFINE(RXVT_SCROLLBAR, 1, Support Rxvt original style scrollbars)
-  scrolltypes="rxvt"
+  scrolltypes="$scrolltypes rxvt"
 fi
 if test x$support_scroll_next = xyes; then
   AC_DEFINE(NEXT_SCROLLBAR, 1, Support NeXT style scrollbars)
@@ -660,10 +654,6 @@ if test x$support_scroll_xterm = xyes; then
   AC_DEFINE(XTERM_SCROLLBAR, 1, Support Xterm style scrollbars)
   scrolltypes="$scrolltypes xterm"
 fi
-if test x$support_scroll_plain = xyes; then
-  AC_DEFINE(PLAIN_SCROLLBAR, 1, Support plain style scrollbars)
-  scrolltypes="$scrolltypes plain"
-fi
 if test x$support_pointer_blank = xyes; then
   AC_DEFINE(POINTER_BLANK, 1, Define if you want hide the pointer while typing)
 fi
index 0930bff..0e65556 100644 (file)
@@ -2396,12 +2396,6 @@ Add support for a NeXT-like scrollbar.
 
 Add support for an Xterm-like scrollbar.
 
-=item --enable-plain-scroll (default: on)
-
-Add support for a very unobtrusive, plain-looking scrollbar that
-is the favourite of the rxvt-unicode author, having used it for
-many years.
-
 =item --disable-backspace-key
 
 Removes any handling of the backspace key by us - let the X server do it.
index 4059af0..135940b 100644 (file)
@@ -1292,10 +1292,8 @@ bgPixmap_t::apply ()
             {
               XSetWindowBackgroundPixmap (target->dpy, target->parent[0], pixmap);
               XSetWindowBackgroundPixmap (target->dpy, target->vt, ParentRelative);
-#  if HAVE_SCROLLBARS
               if (target->scrollBar.win)
                 XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative);
-#  endif
             }
           else
 # endif
@@ -1305,10 +1303,8 @@ bgPixmap_t::apply ()
               XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
               XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap);
               /* do we also need to set scrollbar's background here ? */
-# if HAVE_SCROLLBARS
               if (target->scrollBar.win)
                   XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
-# endif
             }
         }
       else
@@ -1317,22 +1313,18 @@ bgPixmap_t::apply ()
           XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]);
           XSetWindowBackground (target->dpy, target->vt, target->pix_colors[Color_bg]);
           /* do we also need to set scrollbar's background here ? */
-# if HAVE_SCROLLBARS
           if (target->scrollBar.win)
               XSetWindowBackground (target->dpy, target->scrollBar.win, target->pix_colors[Color_border]);
-# endif
         }
       /* don't want Expose on the parent or vt. It is better to use
          scr_touch or we get a great deal of flicker otherwise: */
       XClearWindow (target->dpy, target->parent[0]);
 
-# if HAVE_SCROLLBARS
       if (target->scrollBar.win)
         {
           target->scrollBar.setIdle ();
           target->scrollbar_show (0);
         }
-# endif
 
       target->want_refresh = 1;
       flags |= hasChanged;
index cbc0118..5b7b9e7 100644 (file)
@@ -269,9 +269,7 @@ const char *const def_colorName[] =
 #ifdef OPTION_HC
     NULL,
 #endif
-#ifdef HAVE_SCROLLBARS
     COLOR_SCROLLBAR,
-#endif
 #ifdef RXVT_SCROLLBAR
     COLOR_SCROLLTROUGH,
 #endif
@@ -489,9 +487,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 # endif
 #endif
 
-#ifdef HAVE_SCROLLBARS
   setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]);
-#endif
 
 #ifdef XTERM_REVERSE_VIDEO
   /* this is how xterm implements reverseVideo */
@@ -557,10 +553,8 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
   keyboard->register_done ();
 #endif
 
-#ifdef HAVE_SCROLLBARS
   if (option (Opt_scrollBar))
     scrollBar.setIdle ();    /* set existence for size calculations */
-#endif
 
   pty = ptytty::create ();
 
@@ -574,10 +568,8 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
   XSynchronize (dpy, True);
 #endif
 
-#ifdef HAVE_SCROLLBARS
   if (option (Opt_scrollBar))
     resize_scrollbar ();      /* create and map scrollbar */
-#endif
 #ifdef HAVE_BG_PIXMAP
   {
     bgPixmap.set_target (this);
index 404c984..4a82088 100644 (file)
@@ -174,9 +174,7 @@ rxvt_term::rxvt_term ()
 #if ENABLE_TRANSPARENCY || ENABLE_PERL
   rootwin_ev.set          <rxvt_term, &rxvt_term::rootwin_cb> (this),
 #endif
-#ifdef HAVE_SCROLLBARS
   scrollbar_ev.set        <rxvt_term, &rxvt_term::x_cb>       (this),
-#endif
 #ifdef USE_XIM
   im_ev.set               <rxvt_term, &rxvt_term::im_cb>      (this),
 #endif
@@ -339,9 +337,7 @@ rxvt_term::destroy ()
 #if USE_XIM
       im_ev.stop (display);
 #endif
-#if HAVE_SCROLLBARS
       scrollbar_ev.stop (display);
-#endif
 #if ENABLE_TRANSPARENCY || ENABLE_PERL
       rootwin_ev.stop (display);
 #endif
index cfa7f1c..f3f1110 100644 (file)
   def (loginShell)
   def (jumpScroll)
   def (skipScroll)
-#ifdef HAVE_SCROLLBARS
   def (scrollBar)
   def (scrollBar_right)
   def (scrollBar_floating)
   def (scrollBar_align)
   def (scrollstyle)
   def (scrollBar_thickness)
-#endif
   def (scrollTtyOutput)
   def (scrollTtyKeypress)
   def (scrollWithBuffer)
index 9fd48c8..289af5e 100644 (file)
@@ -270,10 +270,6 @@ struct mouse_event {
 
 #define scrollBar_esc           30
 
-#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
-# define HAVE_SCROLLBARS 1
-#endif
-
 #if !defined (RXVT_SCROLLBAR) && !defined (NEXT_SCROLLBAR)
 # define NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING 1
 #endif
@@ -494,9 +490,7 @@ enum colour_list {
 #ifdef OPTION_HC
   Color_HC,
 #endif
-#ifdef HAVE_SCROLLBARS
   Color_scroll,
-#endif
 #ifdef RXVT_SCROLLBAR
   Color_trough,
 #endif
@@ -1150,9 +1144,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
   void x_cb (XEvent &xev);
   xevent_watcher termwin_ev;
   xevent_watcher vt_ev;
-#ifdef HAVE_SCROLLBARS
   xevent_watcher scrollbar_ev;
-#endif
 
   void child_cb (ev::child &w, int revents); ev::child child_ev;
   void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev;
index 701b4a0..22d7591 100644 (file)
 
 #include "perlxsi.c"
 
-#ifdef HAVE_SCROLLBARS
-# define GRAB_CURSOR THIS->scrollBar.leftptr_cursor
-#else
-# define GRAB_CURSOR None
-#endif
+#define GRAB_CURSOR THIS->scrollBar.leftptr_cursor
 
 #undef LINENO
 #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows)
index 554e05b..dd35c28 100644 (file)
@@ -2476,14 +2476,12 @@ rxvt_term::scr_recolour () NOTHROW
   XClearWindow (dpy, parent[0]);
   XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
 
-# if HAVE_SCROLLBARS
   if (scrollBar.win)
    {
      XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
      scrollBar.setIdle ();
      scrollbar_show (0);
    }
-# endif
 
   scr_clear ();
   scr_touch (true);
index 5ef69f0..66f2533 100644 (file)
@@ -36,7 +36,6 @@ rxvt_term::scrollbar_mapping (int map)
 {
   int change = 0;
 
-#ifdef HAVE_SCROLLBARS
   if (map)
     {
       scrollBar.setIdle ();
@@ -56,7 +55,6 @@ rxvt_term::scrollbar_mapping (int map)
       XUnmapWindow (dpy, scrollBar.win);
       change = 1;
     }
-#endif
 
   return change;
 }
@@ -64,7 +62,6 @@ rxvt_term::scrollbar_mapping (int map)
 void
 rxvt_term::resize_scrollbar ()
 {
-#ifdef HAVE_SCROLLBARS
   int delayed_init = 0;
 
 #define R_SCROLLBEG_XTERM      0
@@ -135,7 +132,6 @@ rxvt_term::resize_scrollbar ()
 
   if (delayed_init)
     XMapWindow (dpy, scrollBar.win);
-#endif
 }
 
 /*
@@ -145,7 +141,6 @@ int
 rxvt_term::scrollbar_show (int update)
 {
   int             ret = 0;
-#ifdef HAVE_SCROLLBARS
   int             top, bot, len, adj;
 
   if (!scrollBar.state)
@@ -174,7 +169,6 @@ rxvt_term::scrollbar_show (int update)
   scrollBar.last_top = scrollBar.top;
   scrollBar.last_bot = scrollBar.bot;
   scrollBar.last_state = scrollBar.state;
-#endif
 
   return ret;
 }
@@ -182,7 +176,6 @@ rxvt_term::scrollbar_show (int update)
 void
 rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness)
 {
-#ifdef HAVE_SCROLLBARS
   int             i;
   short           style, width;
 
@@ -248,7 +241,6 @@ rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, co
   scrollBar.last_bot = scrollBar.last_state = -1;
   /* cursor scrollBar: Black-on-White */
   scrollBar.leftptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
-#endif
 }
 
 /*----------------------- end-of-file (C source) -----------------------*/
index 44d80e4..3bf2405 100644 (file)
@@ -98,14 +98,12 @@ optList[] = {
               BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"),
               BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"),
               BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"),
-#if HAVE_SCROLLBARS
               RSTRG (Rs_scrollstyle, "scrollstyle", "mode"),
               BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, 0, "scrollbar"),
               BOOL (Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, 0, "scrollbar right"),
               BOOL (Rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, 0, "scrollbar without a trough"),
               RSTRG (Rs_scrollBar_align, "scrollBar_align", "mode"),
               STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"),
-#endif
               BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, 0, NULL),
               BOOL (Rs_scrollTtyOutput, NULL, "si",  Opt_scrollTtyOutput, Optflag_Reverse, "scroll-on-tty-output inhibit"),
               BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, 0, "scroll-on-keypress"),
@@ -174,9 +172,7 @@ optList[] = {
 #if ENABLE_FRILLS
               RSTRG (Rs_color + Color_underline, "underlineColor", "color"),
 #endif
-#ifdef HAVE_SCROLLBARS
               RSTRG (Rs_color + Color_scroll, "scrollColor", "color"),
-#endif
 #ifdef RXVT_SCROLLBAR
               RSTRG (Rs_color + Color_trough, "troughColor", "color"),
 #endif
@@ -365,31 +361,15 @@ static const char optionsstring[] = "options: "
 #if defined(NO_RESOURCES)
                                     "NoResources,"
 #endif
-                                    "scrollbars="
-#if !defined(HAVE_SCROLLBARS)
-                                    "NONE"
-#else
-# if defined(PLAIN_SCROLLBAR)
-                                    "plain"
-#  if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)
-                                    "+"
-#  endif
-# endif
-# if defined(RXVT_SCROLLBAR)
-                                    "rxvt"
-#  if defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR)
-                                    "+"
-#  endif
-# endif
-# if defined(NEXT_SCROLLBAR)
-                                    "NeXT"
-#  if defined(XTERM_SCROLLBAR)
-                                    "+"
-#  endif
-# endif
-# if defined(XTERM_SCROLLBAR)
-                                    "xterm"
-# endif
+                                    "scrollbars=plain"
+#if defined(RXVT_SCROLLBAR)
+                                    "+rxvt"
+#endif
+#if defined(NEXT_SCROLLBAR)
+                                    "+NeXT"
+#endif
+#if defined(XTERM_SCROLLBAR)
+                                    "+xterm"
 #endif
                                     "\nUsage: ";               /* Usage */