[Geany-devel] Multiple instances of Geany issues

Lex Trotman elextr at xxxxx
Fri May 21 04:34:36 UTC 2010


Hi All,

I've created this thread separate from Eugene's and Ditmar's session
management threads because my concern is mostly about other parts of Geany
and I don't want to be seen as criticising either of them as it was their
input that started me thinking.

Having multiple Geany instances is a great capability,

*  I can have two (or more) projects open to share code or to interrupt work
on one to do something an another,
*  I can have Geany on *both* of my screens so I can see different parts of
what I'm working on
*  I can set up my filemanager to open different instances so opening random
files won't affect the work I'm doing

My concern is that we should make sure that the way Geany works is safe and
preferably causes no surprises when multiple instances are sharing files.

There are three types of files that Geany instances could share and I think
they should be handled differently:

*  Files being edited (the second of my use cases above).  I don't think it
is up to Geany to handle users editing the same file in multiple instances,
its up to the user to sort it out when time comes to save.  A user can
always set readonly to protect against themselves.  Making --readonly a
command line option would be a good addition.

* Project files (same project in two instances), since the user doesn't
explicitly control the project file I think Geany is going to have to become
involved in this case.  The only options that I can see in this case are:

**  when a project file has changed on disk (by date/time), for Geany to ask
if it should save or save as or throw away any changes to project from this
instance.  This way an instance won't silently overwrite changes made by
another instance, and with save as I can procrastinate by saving this
instances changes elsewhere until I can decide which I want.

** only the Geany not started with --new-instance can save the project file

*  Geany.conf (shared by any two or more instances), this is a real
potential problem if multiple instances try to save the same file.
Discussions in another thread seemed to come to the conclusion that only the
Geany that was started without --new-instance should save it preventing
races when several instances are closed at once.  BUT this is not
implemented in the SVN that is about to become 0.19 and in my test a new
instance overwrote the main Geany.conf losing session, recent files etc!!!

I think that preventing --new-instance from saving project and preference
files should be implemented before 0.19 is released otherwise failing to
close instances in the right order or missing an instance when logging out
will overwrite the preferences.  And configuring a filemanager to use
--new-instance will overwrite when closed even if no other Geany is running.

Later on we can look at the other options and also look at indicating to the
user which Geany instances can save, maybe by something after the Geany in
the title bar?

Cheers
Lex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100521/d6a852e1/attachment.html>


More information about the Devel mailing list