From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA28958; Thu, 7 Feb 2002 09:45:36 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA28084 for ; Thu, 7 Feb 2002 09:45:35 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g178jX928759 for ; Thu, 7 Feb 2002 09:45:34 +0100 (MET) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id RAA16966; Thu, 7 Feb 2002 17:45:28 +0900 (JST) To: tews@tcs.inf.tu-dresden.de Cc: caml-list@inria.fr, lablgtk@kaba.or.jp Subject: Re: [Caml-list] lablgtk question: catching server shutdown In-Reply-To: <15455.46586.298770.173632@gargle.gargle.HOWL> References: <15455.46586.298770.173632@gargle.gargle.HOWL> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020207174528T.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 07 Feb 2002 17:45:28 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Hendrik Tews > I have a lablgtk question: > > Is there a canonical way to register a function that will be > called when the connection to the X server is lost? > > I looked at the gtk sources (version 1.2.9) and there they > register the function gdk_x_io_error with XSetIOErrorHandler. And > gdk_x_io_error prints > > Gdk-ERROR **: X connection to :0.0 broken (explicit kill or server shutdown). > > and calls exit. So it looks like there is no way to register a > callback for this event. Am I right? You can try to add a bit of C code to your application, and call XSetIOErrorHandler after GDK is initialized, to override this default. However, they probably have good reasons to call exit systematically, and you would be left with lots of dangling data. For instance, the GC may trigger the deallocation of X resources; this will not be clean if the connection to X is lost. Jacques Garrigue ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr