[Top][All Lists]

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

Re: emacs --daemon and GDK default display

From: Jan Djärv
Subject: Re: emacs --daemon and GDK default display
Date: Wed, 25 Mar 2009 20:21:04 +0100
User-agent: Thunderbird (Macintosh/20081209)

Ulrich Mueller skrev:
On Mon, 23 Mar 2009, Jan Djärv wrote:

If I remember correctly, the display manager does not set a new
default display when the old is closed. There is some code for that
case i gtkutil.c.

But there was a bug in it. I don't know if that fixes anything, but
please try again.

This wouldn't help, since the segmentation fault already happens in
gdk_display_open, so it doesn't reach the code affected by your
change of today.

Note that closing displays under Gtk+ is generally buggy in itself.
If you can capture a stack trace in the debugger

A GDB backtrace is attached to our downstream bug at
<http://bugs.gentoo.org/attachment.cgi?id=185188>. Unfortunately,
without symbols in Emacs. ;-) But I think that there's enough
information to see what is going on.

we should be able to tell if it is Gtk+ or Emacs that is doing the
wrong thing.

There's definitely a problem in libcanberra which fails to check for a
null pointer (already reported to its upstream).

Okay, now I see it in the stack trace Austin posted, thanks.

Emacs opens the first display, and that becomes the
default display.  Then that display is closed, and there is no default
display. When a new display is opened, it does not become the default display. The gdk_display_open function calls libcanberra before Emacs has a chance to set the default display. Maybe this could be seen as a bug in Gtk+.
I see that the code in Gtk+ kind of assumes that once the default display is
open, it is never closed.

The module initialization, of which libcanberra is part, is triggered by the
display_opened signal.  It should be possible to manipulate that signal so
it is either delayed or intercepted. However, I don't have libcanberra here where I am currently. I'll be back at home in a couple of days, I'll try
something then.

The question is if Emacs could do anything to work around the problem?
I suppose you can't set a default display before calling

No, but if Emacs can catch the display_opened signal first it can set the default display before libcanberra is called.

I am thinking of filing an Gtk+ bug on this, but I have to have the proper
setup myself first.

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]