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

Bug#307216: xterm colorization problems



Package: xterm
Version: 4.3.0.dfsg.1-12.0.1
Severity: important
Tags: patch

Xterm has some colorization problems which are pop-up for example if you
read your eMail in mutt in a screen. The problem is:

	From: Thomas Dickey <dickey@his.com>
	To: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
	Subject: Re: Color problems with xterm-201
	Date: Sun, 1 May 2005 15:31:09 -0400
	I found the problem (took about an hour).  It was when xterm was writing
	out pending data, updated the display's colors and didn't restore.  That
	happened to be in one of those rarely-needed checks - it had some data
	leftover telling it to scroll just as it started writing new data.

	This fragment in charproc.c:

		if (!AddToRefresh(screen)) {
		    /* make sure that the correct GC is current */
		    currentGC = updatedXtermGC(screen, flags, fg_bg, False);

		    if (screen->scroll_amt)
			FlushScroll(screen);

	doesn't account for that one of the functions called by FlushScroll()
	could modify the display's colors as is done in updatedXtermGC().

	What's odd is that the code is very old - and no one reported it before.
	I see the updatedXtermGC() call from 1996.  (On the other hand, I've
	encountered bugs that old more than once).

	Anyway, the fix for that is to move the assignment past the if statement:

		if (!AddToRefresh(screen)) {

		    if (screen->scroll_amt)
			FlushScroll(screen);

		    /* make sure that the correct GC is current */
		    currentGC = updatedXtermGC(screen, flags, fg_bg, False);

	I'll check for other occurrences, of course.

The attached patch fixes the described problem. Please apply and
recompile.

--- xterm-201/charproc.c~redraw
+++ xterm-201/charproc.c
@@ -3435,12 +3435,13 @@
 	    InsertChar(screen, cells);
 	}
 	if (!AddToRefresh(screen)) {
-	    /* make sure that the correct GC is current */
-	    currentGC = updatedXtermGC(screen, flags, fg_bg, False);
 
 	    if (screen->scroll_amt)
 		FlushScroll(screen);
 
+	    /* make sure that the correct GC is current */
+	    currentGC = updatedXtermGC(screen, flags, fg_bg, False);
+
 	    if (flags & INVISIBLE) {
 		if (cells > len) {
 		    str = temp_str = malloc(cells);

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (1050, 'testing'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.30
Locale: LANG=C, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)

Versions of packages xterm depends on:
ii  libc6                2.3.2.ds1-21        GNU C Library: Shared libraries an
ii  libexpat1            1.95.8-1            XML parsing C library - runtime li
ii  libfontconfig1       2.3.1-2             generic font configuration library
ii  libfreetype6         2.1.7-2.4           FreeType 2 font engine, shared lib
ii  libice6              4.3.0.dfsg.1-12.0.1 Inter-Client Exchange library
ii  libncurses5          5.4-4               Shared libraries for terminal hand
ii  libsm6               4.3.0.dfsg.1-12.0.1 X Window System Session Management
ii  libxaw7              4.3.0.dfsg.1-12.0.1 X Athena widget set library
ii  libxext6             4.3.0.dfsg.1-12.0.1 X Window System miscellaneous exte
ii  libxft2              2.1.7-1             FreeType-based font drawing librar
ii  libxmu6              4.3.0.dfsg.1-12.0.1 X Window System miscellaneous util
ii  libxpm4              4.3.0.dfsg.1-12.0.1 X pixmap library
ii  libxrender1          0.8.3-7             X Rendering Extension client libra
ii  libxt6               4.3.0.dfsg.1-12.0.1 X Toolkit Intrinsics
ii  xlibs                4.3.0.dfsg.1-12     X Keyboard Extension (XKB) configu
ii  xlibs-data           4.3.0.dfsg.1-12     X Window System client data

-- debconf-show failed



Reply to: