Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
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
Date: Thu, 07 Feb 2002 17:45:28 +0900	[thread overview]
Message-ID: <20020207174528T.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <15455.46586.298770.173632@gargle.gargle.HOWL>

From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>

> 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


      reply	other threads:[~2002-02-07  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 10:37 Hendrik Tews
2002-02-07  8:45 ` Jacques Garrigue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020207174528T.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=lablgtk@kaba.or.jp \
    --cc=tews@tcs.inf.tu-dresden.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox