Hi everybody!

Here is the result of my attempt to modify the way SciTE exits.
I basically implemented what we had discussed:
  - QuitSignal() now simply calls QuitProgram()
  - QuitProgram() does calls gtk_main_quit(), not gtk_exit()
  - CheckForRunningInstance() returns a boolean, and Run()
    returns if necessary, instead of exiting directly.

All in all, this allows gtk_main_quit() to do its job, like
storing the clipboard, and by ending gracefully, the objects are
always correctly destroyed.

However, this is not ready to be committed yet, as the pipe
issues remain. I discovered that the pipe used for the single
instance was only removed if you quitted by closing the window,
but not if you quitted using the menu item, unless you had 
defined NO_FILER (which disables the Director extension). As for
the pipes used by the Director extension, they were never
removed because the code uses wrong property names.

In my patch, I removed the code that was supposed to clean the
director pipes. I don't know how to fix this correctly, because
I'm unsure how the single instance code and the Director
extension play together, even though they were added by the same
person (btw, Ashley, if you're still reading the mailing list
after 6 years, we need your help ;)). The single instance is
supposed to use ipc.scite.name if it is defined, instead of
using /tmp/.SciTE.username.ipc, but CheckForRunningInstance is
not called if ipc.director.name is set... which is a bit strange
given what Steve Donovan wrote in the documentation for
scite-gdb:

  "Note that the output pipe referenced by 'ipc.director.name'
  is not used by scite-gdb, but the Director interface
  requires it to be non-empty."

However, I haven't tested scite-gdb, and I tried to compile
scitepm, but it didn't work... which means I haven't been able
to test the Director interface. I have the feeling that when the
Director extension is used, the single instance code doesn't
work. If this the way it is supposed to work, because it doesn't
make sense to have check.if.already.open set to 1 when using
a program using the Director extension? Or is this a bug that
needs fixing?

A bit of history. The interesting revisions of SciTEGTK.cxx
are the following ones:
  1.22; 1.55; 1.58, 1.59 and 1.60; 1.103; 1.130; 1.254
The most interesting one for the remaining problems is 1.130,
23d June 2001, which is when the Director interface was added.
There are some posts in the mailing list archives about it [1].

Okay, I'll stop here. If anybody knows enough about the Director
interface to know how to deal with single instance and a project
manager or similar at the same time, and can contribute the code
to remove the pipes created by the extension, he's very welcome
to do so. Otherwise, I'll have some spare time in two days, so
I may be able to have a closer look.

As always when I wrote such long texts in English, I hope this
can be understood! :D
Nicolas

[1]
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/796991
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797022
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797024
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797027
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797032
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797064
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797065
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797066
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/797068
there are probably more, like the thread starting at:
http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/796176

Attachment: SciTEGTK.diff
Description: Binary data

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to