Subject: Re: bug#5938: Unnecessary fail when XGetVisualInfo returns multiple records
From: Jan Djärv <[email-masked]>
To: Lynn Winebarger <[email-masked]>
Cc: [email-masked]
Date: Mon, 12 Apr 2010 21:01:10 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Lynn Winebarger skrev:
> Package: emacs
> Version: 23.1.50; 23.1.1; 22.2.1
> 
> When invoking emacs on a remote session using Xephyr, it responds
> emacs: Can't get proper X visual info
> In version 22 there is a newline after the message, in version 23
> there is no newline.
> 
> I've traced the problem to the function select_visual in the file xfns.c.  If
> the resource database does not specify a preference, it attempts to use
> the default visual by getting a screen number and visual id from the supplied
> dpyinfo structure.
> 
> For some reason Xephyr returns multiple records corresponding to the
> same visual id.
> This shows up in xpdyinfo as well, output at the end of this email.
> The default id is 0x21,
> and there are two identical entries for it.  Every other visual id has
> a single record.

It sounds like a bug to return two identical visuals, I haven't seen that widh 
Xephyr.  But in any case, Emacs should not abort.  On the whole, the whole 
checking of visual is kind of redundant anyway, DefaultVisualOfScreen shall 
always exist.

Fix checked in.

	Jan D.