Better fix for the border bug



Hello!

I'm applying a better fix for the border bug. Many thanks to the S-Lang
author John E. Davis for finding the real problem. The old patch is being
reverted.

ChangeLog
	* color.c (init_colors) [HAVE_SLANG]: Use SLtt_set_color() to
	associate the default colors with DEFAULT_COLOR_INDEX. The old
	code would unset alternative charset without making S-Lang aware
	of it.
	Thanks to John E. Davis <davis space mit edu>
	* widget.c (update_input) [HAVE_SLANG]: Revert last change - it
	is not needed now.

________________________________
--- color.c
+++ color.c
@@ -294,15 +294,12 @@ void init_colors (void)
 #endif

 #if defined HAVE_SLANG && !defined(HAS_DIRECT_COLOR_ACCESS)
-	if (use_colors) { /* Hack to make COLOR_PAIR(DEFAULT_COLOR_INDEX)
-                             be the default fg/bg of the terminal */
-	    char *Norm_Vid = SLtt_tgetstr ("me");
-
-	    if (Norm_Vid == NULL)
-	        Norm_Vid = SLtt_tgetstr ("se");
-	    if (Norm_Vid == NULL)
-	        Norm_Vid = "\033[0m";
-	    SLtt_set_color_esc (DEFAULT_COLOR_INDEX, Norm_Vid);
+	if (use_colors) { /* We are relying on undocumented feature of
+			     S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX)
+			     the default fg/bg of the terminal.
+			     Hopefully, future versions of S-Lang will
+			     document this feature. */
+	    SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, NULL, NULL);
 	}
 #endif

--- widget.c
+++ widget.c
@@ -840,24 +840,9 @@ update_input (WInput *in, int clear_firs

     attrset (in->color);

-#ifdef HAVE_SLANG
-    /*
-     * acs() and noacs() here are a workaround for what seems to be
-     * a bug in SLang 1.x (up to 1.4.4, but not in 0.99.38). Without
-     * them, the first dialog box to appear may have part of its
-     * frame displayed in ASCII characters instead of line drawing
-     * characters. Subshell support and color terminal are needed for
-     * the bug to show up.
-     */
-    acs ();
-    SLsmg_fill_region (in->widget.y, in->widget.x,
-		       1, in->field_len - has_history, ' ');
-    noacs ();
-#else
     widget_move (&in->widget, 0, 0);
     for (i = 0; i < in->field_len - has_history; i++)
 	addch (' ');
-#endif
     widget_move (&in->widget, 0, 0);

     for (i = 0, j = in->first_shown; i < in->field_len - has_history && in->buffer [j]; i++){
________________________________

Regards,
Pavel Roskin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]