<br><br><div class="gmail_quote">On 21 May 2010 15:13, Eugene Arshinov <span dir="ltr"><<a href="mailto:earshinov@gmail.com">earshinov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, 21 May 2010 14:34:36 +1000%<br>
Lex Trotman <<a href="mailto:elextr@gmail.com">elextr@gmail.com</a>> wrote:<br>
<br>
> Hi All,<br>
><br>
> I've created this thread separate from Eugene's and Ditmar's session<br>
> management threads because my concern is mostly about other parts of<br>
> Geany and I don't want to be seen as criticising either of them as it<br>
> was their input that started me thinking.<br>
><br>
<br>
</div>New thread is a good idea. I am tired of looking up for recent<br>
messages in that large "Race condition" thread I created :-)<br>
<div><div></div><div class="h5"><br>
> Having multiple Geany instances is a great capability,<br>
><br>
> * I can have two (or more) projects open to share code or to<br>
> interrupt work on one to do something an another,<br>
> * I can have Geany on *both* of my screens so I can see different<br>
> parts of what I'm working on<br>
> * I can set up my filemanager to open different instances so opening<br>
> random files won't affect the work I'm doing<br>
><br>
> My concern is that we should make sure that the way Geany works is<br>
> safe and preferably causes no surprises when multiple instances are<br>
> sharing files.<br>
><br>
> There are three types of files that Geany instances could share and I<br>
> think they should be handled differently:<br>
><br>
> * Files being edited (the second of my use cases above). I don't<br>
> think it is up to Geany to handle users editing the same file in<br>
> multiple instances, its up to the user to sort it out when time comes<br>
> to save. A user can always set readonly to protect against<br>
> themselves. Making --readonly a command line option would be a good<br>
> addition.<br>
><br>
> * Project files (same project in two instances), since the user<br>
> doesn't explicitly control the project file I think Geany is going to<br>
> have to become involved in this case. The only options that I can<br>
> see in this case are:<br>
><br>
> ** when a project file has changed on disk (by date/time), for Geany<br>
> to ask if it should save or save as or throw away any changes to<br>
> project from this instance. This way an instance won't silently<br>
> overwrite changes made by another instance, and with save as I can<br>
> procrastinate by saving this instances changes elsewhere until I can<br>
> decide which I want.<br>
><br>
> ** only the Geany not started with --new-instance can save the<br>
> project file<br>
><br>
<br>
</div></div>The second option seems strange to me. Practically, it will forbid<br>
opening two projects simultaneously so that they are both saved. Or do<br>
I miss something?<br></blockquote><div><br>Nope, I didn't say it was a good solution :-) or necessarily the final solution but it could be done before 0.19.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Also, I can't see the point in opening one project in two instances…<br>
So, as to me, it isn't worth writing any code to handle that.<br>
<br></blockquote><div><br>To get two windows with the same configuration. My particular area is the build config, but more and more prefs are getting overridden in the project file like long line was recently etc.<br><br>
Leaving a known potential problem situation in the release is IMHO bad, even if we think its likely to be rare. Its particularly bad if I get bit by it :-)<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> * Geany.conf (shared by any two or more instances), this is a real<br>
<div class="im">> potential problem if multiple instances try to save the same file.<br>
> Discussions in another thread seemed to come to the conclusion that<br>
> only the Geany that was started without --new-instance should save it<br>
> preventing races when several instances are closed at once. BUT this<br>
> is not implemented in the SVN that is about to become 0.19 and in my<br>
> test a new instance overwrote the main Geany.conf losing session,<br>
> recent files etc!!!<br>
><br>
> I think that preventing --new-instance from saving project and<br>
> preference files should be implemented before 0.19 is released<br>
> otherwise failing to close instances in the right order or missing an<br>
> instance when logging out will overwrite the preferences. And<br>
> configuring a filemanager to use --new-instance will overwrite when<br>
> closed even if no other Geany is running.<br>
><br>
<br>
</div>Well, actually there is a very simple solution -- just check if we are<br>
run with --new-instance in `configuration_save' and forbid saving<br>
anything in this case. This is what I committed to SM.<br></blockquote><div><br>I thought you had but I couldn't find it in "the big thread" :-) can you extract that as a patch against SVN?<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
But now there is a suggestion from Dimitar to also support changing<br>
preferences in secondary instances. The last solution I wrote in "the<br>
large thread" is to change automatic saving when closing. It should<br>
save only things that are not related to Preferences dialog (window<br>
position, opened files if needed etc.), and only in the main instance,<br>
of course. Changed preferences are saved immediately after applying<br>
changes user made in the Preferences dialog, either in a main instance<br>
or a secondary instance.<br>
<br></blockquote><div><br>Have to think carefully about which things are in which category, maybe it could be ok, and could be applied to the project files as well. Reload would be good as well so that settings can be transferred between instances.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
As to me, I don't need to be able to change prefs in secondary<br>
instances as I always have main instance running. But this feature<br>
might be useful to other Geany users…<br></blockquote><div><br>Sure.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> Later on we can look at the other options and also look at indicating<br>
> to the user which Geany instances can save, maybe by something after<br>
> the Geany in the title bar?<br>
><br>
<br>
</div>As to me, the title is already "overcrowded" (for example, just now I<br>
have "notes.html - /home/eugene - [home] - Geany"). Instead, I would<br>
like to see this indication in the status bar.<br></blockquote><div><br>Sure, fine by me.<br><br>Cheers<br>Lex<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5"><br>
Best regards,<br>
Eugene.<br>
_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
</div></div></blockquote></div><br>