From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: emacs --daemon and GDK default display Date: Wed, 25 Mar 2009 20:21:04 +0100 Message-ID: <49CA8420.7090000@swipnet.se> References: <18879.34340.349741.391197@a1ihome1.kph.uni-mainz.de> <49BF8DD5.2030502@gnu.org> <18887.22064.669003.766051@a1i15.kph.uni-mainz.de> <49C7C250.9030505@swipnet.se> <18888.50.303190.358177@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: Quoted-Printable X-Trace: ger.gmane.org 1238008911 22408 80.91.229.12 (25 Mar 2009 19:21:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2009 19:21:51 +0000 (UTC) Cc: Jason Rumney , emacs-devel@gnu.org To: Ulrich Mueller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 25 20:23:08 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LmYgY-0003XI-UT for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 20:22:47 +0100 Original-Received: from localhost ([127.0.0.1]:56920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmYfB-000270-VB for ged-emacs-devel@m.gmane.org; Wed, 25 Mar 2009 15:21:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmYf6-00026p-7u for emacs-devel@gnu.org; Wed, 25 Mar 2009 15:21:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmYf0-00026A-Bx for emacs-devel@gnu.org; Wed, 25 Mar 2009 15:21:14 -0400 Original-Received: from [199.232.76.173] (port=53207 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmYf0-000262-6f for emacs-devel@gnu.org; Wed, 25 Mar 2009 15:21:10 -0400 Original-Received: from proxy2.bredband.net ([195.54.101.72]:51600) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LmYey-0004de-G6; Wed, 25 Mar 2009 15:21:08 -0400 Original-Received: from ironport2.bredband.com (195.54.101.122) by proxy2.bredband.net (7.3.139) id 49C917E200076F73; Wed, 25 Mar 2009 20:21:06 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8vAHQhyklV4S1uPGdsb2JhbACBUJQkAQEBATW9L4N1Bg X-IronPort-AV: E=Sophos;i="4.38,420,1233529200"; d="scan'208";a="466508478" Original-Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by ironport2.bredband.com with ESMTP; 25 Mar 2009 20:21:06 +0100 Original-Received: from c-89-160-50-208.cust.bredband2.com (c-89-160-50-208.cust.bredband2.com [89.160.50.208]) by coolsville.localdomain (Postfix) with ESMTPSA id 49B947FA07B; Wed, 25 Mar 2009 20:21:05 +0100 (CET) User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) In-Reply-To: <18888.50.303190.358177@a1ihome1.kph.uni-mainz.de> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109842 Archived-At: Ulrich Mueller skrev: >>>>>> On Mon, 23 Mar 2009, Jan Dj=E4rv wrote: >=20 >> 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. >=20 >> But there was a bug in it. I don't know if that fixes anything, but >> please try again. >=20 > 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. >=20 >> Note that closing displays under Gtk+ is generally buggy in itself. >> If you can capture a stack trace in the debugger >=20 > A GDB backtrace is attached to our downstream bug at > . Unfortunately, > without symbols in Emacs. ;-) But I think that there's enough > information to see what is going on. >=20 >> we should be able to tell if it is Gtk+ or Emacs that is doing the >> wrong thing. >=20 > 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=20 display. The gdk_display_open function calls libcanberra before Emacs has= a=20 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 s= o it is either delayed or intercepted. However, I don't have libcanberra h= ere=20 where I am currently. I'll be back at home in a couple of days, I'll try something then. >=20 > The question is if Emacs could do anything to work around the problem? > I suppose you can't set a default display before calling > gdk_display_open? >=20 No, but if Emacs can catch the display_opened signal first it can set the= =20 default display before libcanberra is called. I am thinking of filing an Gtk+ bug on this, but I have to have the prope= r setup myself first. Jan D.