Hook for `_exit'
Po Lu
luangruo@yahoo.com
Sat Aug 6 01:37:28 GMT 2022
Paul Eggert <eggert@cs.ucla.edu> writes:
> On 8/5/22 03:52, Po Lu via Libc-alpha wrote:
>> the GTK developers
>> are unwilling to provide proper hooks (or even to use exit) instead.
>
> Matthias suggested in
> <https://gitlab.gnome.org/GNOME/gtk/-/issues/4514> that Emacs could
> use a g_message hook and parse the message to determine that GTK is
> about to _exit. Although a horrible hack, I've seen worse hacks in
> Emacs.
That sounds pretty bad to me, but I think it's workable.
You would have to recognize (at least) the following strings:
"Lost connection to Wayland compositor."
"Error %d (%s) dispatching to Wayland display."
"Error reading events from display: %s"
"Error flushing display: %s"
But Emacs also supports loading dynamic modules. What if a module also
calls g_message with a similar string?
More information about the Libc-alpha
mailing list