Skip to content
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

Non-project session isn't restored after opening several projects #3897

Open
techee opened this issue Jun 8, 2024 · 1 comment · May be fixed by #3898
Open

Non-project session isn't restored after opening several projects #3897

techee opened this issue Jun 8, 2024 · 1 comment · May be fixed by #3898
Labels

Comments

@techee
Copy link
Member

techee commented Jun 8, 2024

Steps to reproduce:

  1. With no project open, open some files
  2. Open project A
  3. Without closing project A first, open project B
  4. Close project B
  5. The originally open files from (1) are gone

Note that simple

  1. With no project open, open some files
  2. Open project A
  3. Close project A

restores the session correctly.

I was wondering whether some of the session-split patches caused this but I checked out Geany 1.35 and it contained the same bug. I haven't investigated more so far.

@techee techee added the bug label Jun 8, 2024
techee added a commit to techee/geany that referenced this issue Jun 8, 2024
Steps to reproduce:
1. With no project open, open some files
2. Open project A
3. Without closing project A first, open project B
4. Close project B
5. The originally open files from (1) are gone

The problem is that when project A closes and all its files are closed,
load_config() gets called which contains

configuration_save_default_session();

This saves the session with all files closed and replaces the original
session.

This patch modifies the code to call configuration_save_default_session()
only when there are some open tabs so the above problem gets solved.

Even though I was worried that this would break saving default session
when all its files get closed and then a project is loaded, it
doesn't seem to be the case (I haven't investigated deep enough why).

An alternative to this approach would be to pass a boolean as a parameter
of quite many functions and propagate the information whether
project close preceded its opening but it introduces a much bigger diff
and makes the complicated session opening stuff even wilder.

Fixes geany#3897.
@elextr
Copy link
Member

elextr commented Jun 9, 2024

Was #267 which the session split claimed to fix, but maybe it has a bug when multiple projects happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants