From 8ffbc36b766d463cb4d86b6c2e5c9054a9c91234 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 12 Sep 2013 10:29:13 +0400 Subject: [PATCH] * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip scroll bar values to prevent thumb from disappear and update comment. --- src/ChangeLog | 5 +++++ src/xterm.c | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e1276f54d03..88aa22b30dc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-09-12 Dmitry Antipov + + * 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 * emacs.c (usage_message): Possessive apostrophe tweak. diff --git a/src/xterm.c b/src/xterm.c index 7ad790edd61..cd60915e056 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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) -- 2.11.4.GIT