[Geany-devel] Signal Handling
Dimitar Zhekov
dimitar.zhekov at xxxxx
Mon Sep 10 17:15:10 UTC 2012
On Sun, 09 Sep 2012 19:41:19 -0700
Matthew Brush <mbrush at codebrainz.ca> wrote:
> On 12-09-09 05:23 PM, Lex Trotman wrote:
> > [...]
> > So can anyone describe a useful use-case for catching SIGTERM and
> > potentially refusing to exit? And also for SIGINT.
> >
>From what I see, signal_cb (used currently for SIGTERM only) looks like
a naive attempt to replace the session management. That will never work,
of course - either the WM will send a SIGKILL quickly (in 1-2 seconds),
or the entire X will terminate, killing Geany.
BTW, I'm happy to inform all Xfce users here that it's session
management was fixed and pushed to git, so we may expect it with the
next xfce-session versions. Using the "Action Buttons" plugin with
Shutdown or Restart will still not work, but that's a different bug. Or
maybe a feature, because the session settings specifically include the
text "... on logout".
> For SIGINT, if it's handled, it'll ask if you want to save unsaved
> documents before closing when Ctrl+C is used from the terminal. Not
> saying whether we should handle it or not, just that it's why my tests
> included it.
My whole X terminates if I run it from a virtual console and press
Ctrl+C, so why should Geany handle the signal? Is this a normal
practice for the GUI programs under X than I'm not aware of?
And of course, the portability of signal(2) is so bad that only SIG_DFL
and SIG_IGN can be trusted.
--
E-gards: Jimmy
More information about the Devel
mailing list