-
Notifications
You must be signed in to change notification settings - Fork 622
Save & restore default session independently of projects (fixes #267) #3125
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
Conversation
c484d7c
to
fa1221b
Compare
I'll merge this in a few days if nobody objects. |
As per geany#267 we agreed that this pref makes little sense. Especially as we're considering to move the project session files to a completely separate file (so neither geany.conf nor $project.geany). Currently, if not checked, the project session files would be stored in the (new) session.conf file, overwriting the non-project session. This is what geany#267 is about.
This flag is actually set and cleared recursively: - libmain.c sets it before calling load_startup_files() - inside load_startup_files(), configuration_open_files() sets and clears the flag - when libmain.c clears the flag, it's already unset A counter allows such recursive usage to work as expected.
Currently, when loading "projects" (i.e. named sessions), the file list overwrites the default session. Therefore, when loading a project, the previously opened files are lost. With this the default session is maintained separately. Any time a project is opened it is written to session.conf and can be restored later on.
When you say "Use Project based session files is now always enabled" you mean when a project is open right? I would like to know somebody has tested it before merge. [Edit: by "somebody else" I mean not @kugel-, not neccessarily somebody other than me, but I can't until late next week at the earliest] |
fa1221b
to
27982f3
Compare
Yes. When a project is open its session files are stored in the project file instead of session.conf (previously geany.conf). This has been the default for years. I can wait another week or two, no problem. Just don't want that this rots for a long time without any feedback. |
@elextr will merge very soon since no objection or further feedback came up the last two weeks. |
I'm deeply sorry for your situation and wish you and the people around you all the best! |
…ession files PR geany#3125 (commit 22aac44) broke that accidentally by moving the "switch to last used tab" to a idle callback (g_idle_add()). This runs after opening files from the command line. Now, the same callback is moved to libmain.c and is only registered when there are no files from the command line. Additionally, projects gains a private copy of the current_page loaded from the keyfile.
…ession files PR geany#3125 (commit 22aac44) broke that accidentally by moving the "switch to last used tab" to a idle callback (g_idle_add()). This runs after opening files from the command line. Now, the same callback is moved to libmain.c and is only registered when there are no files from the command line. Additionally, projects gains a private copy of the current_page loaded from the keyfile. Fixes geany#3210
"switch to last used tab" to a idle callback (g_idle_add()). This runs after opening files from the command line. Now, showing the "current" document is generally done via an idle callback. This is implemented in the new helper "document_show_tab_idle()" that should be used during batch-opening. document_show_tab_idle() is smart enough to only allow the last call to be effective in case it's called multiple times before the idle callback actually runs. command line files, of course, call this after session files. Fixes geany#3210
"switch to last used tab" to a idle callback (g_idle_add()). This runs after opening files from the command line. Now, showing the "current" document is generally done via an idle callback. This is implemented in the new helper "document_show_tab_idle()" that should be used during batch-opening. document_show_tab_idle() is smart enough to only allow the last call to be effective in case it's called multiple times before the idle callback actually runs. command line files, of course, call this after session files. Fixes geany#3210
…ession files (#3267) commit 22aac44 ("Save & restore default session independently of projects", PR #3125) broke that accidentally by moving the "switch to last used tab" to an idle callback. This runs after opening files from the command line. Now, showing the "current" document is generally done via an idle callback. This is implemented in the new helper "document_show_tab_idle()" that should be used during batch-opening. document_show_tab_idle() is smart enough to only allow the last call to be effective in case it's called multiple times before the idle callback actually runs. Command line files, of course, call this after session files. Fixes #3210
…ession files (geany#3267) commit 22aac44 ("Save & restore default session independently of projects", PR geany#3125) broke that accidentally by moving the "switch to last used tab" to an idle callback. This runs after opening files from the command line. Now, showing the "current" document is generally done via an idle callback. This is implemented in the new helper "document_show_tab_idle()" that should be used during batch-opening. document_show_tab_idle() is smart enough to only allow the last call to be effective in case it's called multiple times before the idle callback actually runs. Command line files, of course, call this after session files. Fixes geany#3210
The default session should be stored independently of projects, so that
it can be restored after closing projects; even across restarts of Geany.
To achieve that, internal refactoring is necessary. But more importantly,
the pref "Use project-based session files" must be always enabled,
because only with that enabled the project session files are stored in the
project file.
So the pref is removed. It was already enabled by default, and disabling
has no known sensible use case.
The rest of the refactoring allows "projects" to internally maintain its
open file list without destroying the default session.