Subject: Re: bug#15037: Display can't be opened (display newer than emacs session)

From: Stefan Monnier <[email-masked]>
Date: Wed, 07 Aug 2013 14:19:59 -0400

>> What does M-: (getenv "XAUTHORITY") RET say in those two Emacs sessions?

> For the older session (in the original frame): "/var/run/gdm/auth-for-jsewall-jWCxJH/database"

> For a new session started from display :1.0, 'nil'. 

There's your problem.  You're using GDM3 which has the obnoxious habit
of putting your authorization keys in a separate file and setting
XAUTHORITY to point to it.  So your session doesn't have access to the
keys you have in your ~/.Xauthority and your other sessions don't have access
to this display.

See:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586685
https://bugzilla.gnome.org/show_bug.cgi?id=651431

Note that it's not just Emacs that suffers this way:
If M-x make-frame-on-display <RET> :1.0 <RET> fails for you, then try
(in that very same Emacs) to do M-x shell RET xterm --display :1.0 RET
it should fail in the same way.

        Stefan