]> git.eshelyaron.com Git - emacs.git/commitdiff
* xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 12 Sep 2013 06:29:13 +0000 (10:29 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Thu, 12 Sep 2013 06:29:13 +0000 (10:29 +0400)
scroll bar values to prevent thumb from disappear and update comment.

src/ChangeLog
src/xterm.c

index e1276f54d031e0954874e36655136cc4e850390e..88aa22b30dc97fac401f9951a0d0faa763a7d461 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-12  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip
+       scroll bar values to prevent thumb from disappear and update comment.
+
 2013-09-11  Glenn Morris  <rgm@gnu.org>
 
        * emacs.c (usage_message): Possessive apostrophe tweak.
index 7ad790edd61637418fc9002784358467b10c747f..cd60915e056aae776f486e25b67d744943271f36 100644 (file)
@@ -4798,12 +4798,21 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio
       top = max (0, min (1, top));
     else
       top = old_top;
+#if ! defined (HAVE_XAW3D)
+    /* With Xaw, 'top' values too closer to 1.0 may
+       cause the thumb to disappear.  Fix that.  */
+    top = min (top, 0.99f);
+#endif
     /* Keep two pixels available for moving the thumb down.  */
     shown = max (0, min (1 - top - (2.0f / height), shown));
+#if ! defined (HAVE_XAW3D)
+    /* Likewise with too small 'shown'.  */
+    shown = max (shown, 0.01f);
+#endif
 
-    /* If the call to XawScrollbarSetThumb below doesn't seem to work,
-       check that your system's configuration file contains a define
-       for `NARROWPROTO'.  See s/freebsd.h for an example.  */
+    /* If the call to XawScrollbarSetThumb below doesn't seem to
+       work, check that 'NARROWPROTO' is defined in src/config.h.
+       If this is not so, most likely you need to fix configure.  */
     if (top != old_top || shown != old_shown)
       {
        if (bar->dragging == -1)