New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to prevent reloading projects that are already loaded #2951
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? What are the downsides of reloading projects? Also does reloading a project have useful semantics that this would block, I'm not sure?
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.
Also technically it should be comparing realpath
ed absolute filenames so it won't refuse to load projects of the same name in different directories.
Yes.
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.
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.
|
#2949 means you can avoid this if you don't want it 😄
IIRC all Geany popups are marked modal, so they should take focus, but it is up to the window manager/wayland compositor to grant that. Seems to work here with Cinnamon.
Ok, but project load does cause a signal that plugins might use, do the project plugins do rescans or other stuff when that happens.
Oh, Ok, well no need to add one then, coulda sworn it did, but maybe its been removed, maybe github search knows ... ahh, it used to for a "recent project" open, but that was removed in f40569d.
Yeah, I said "technically", but absolute should be fine most of the time to distinguish two files of the same name in differing directories, only getting confused for smarties with multiple paths to the same file, but in that case its no different to the current situation, so no need for real_path.
Do you get an absolute path from the socket buffer then? BTW I am not saying this PR is a bad idea, just want to be sure the implementation has no negative side effects. |
910cfe3
to
8d2e8ad
Compare
Haha... yes...
It's probably focus stealing prevention... But I prefer no popups in the first place.
Since the project is already open, I'd expect that plugins would have done what they needed the first time the project was opened. I used
Surprisingly, workbench does not respond to any project-based signals. It uses only
My main concern was opening from the file manager, since that's how I've been opening projects. Maybe already-open projects can continue to be re-opened from the menu because "Unlikely to be done accidentally." ? Or the behavior of this PR could be put behind an option, like
I missed the symlink issue. I've changed it to use the real path.
I think so because the filenames are able to match, preventing the project from opening.
My interpretation is that your intention is to improve the PR... Or if it's really misguided, help me figure it out... |
I put the behavior from this PR behind an option in various, "projects.reload_already_open". When a project is prevented from reloading, a message is sent to the status window. I've updated the initial description. |
08d5f64
to
75516f2
Compare
Force push to rebase and combine commits. |
df6f405
to
151ea54
Compare
Force push to rebase and guarantee no conflicts with recent session-split commit. |
This PR adds an option (projects.reload_already_open) to control whether Geany reloads projects that are already loaded.