[Github-comments] [geany/geany] Don't reopen project files that are already open (PR #2951)

xiota notifications at xxxxx
Sun Oct 24 04:00:56 UTC 2021


> Is this needed?

Yes.

> What are the downsides of reloading projects?

* Popup to warn about closing project – waste time closing popup.
* Geany doesn't take focus when it creates popups ­– waste time switching to Geany when it would otherwise take focus.
* Popups to save unsaved files – more wasted time.  And they're annoying.
* Lost undo history.

> Also does reloading a project have useful semantics that this would block, I'm not sure?

Nothing useful.  It creates lots of popups and destroys undo history.  Because of the popups, it's faster to reopen a project by closing and rerunning Geany itself.

> If this is desired it should be applied to UI activated opening as well, by doing this in the project open code, not socket code.

I made the change here because that is where the function to generate the popup is called.  That function does not receive the new project file name, so cannot make a comparison.

When a project is opened from the menu, no warning is generated.  So even if the project were prevented from being opened elsewhere, the change here would still be necessary to prevent the warning dialog from being shown.

> Also technically it should be comparing realpathed absolute filenames so it won't refuse to load projects of the same name in different directories.

`app->project->file_name` contains the full path.  The [`GeanyProject`](https://www.geany.org/manual/reference/structGeanyProject.html) struct does not appear to have a `real_path` component.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2951#issuecomment-950255844
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211023/e63ee291/attachment.htm>


More information about the Github-comments mailing list