When opening a file from command line, with Geany not yet running, the `g_idle_add(...)` https://github.com/geany/geany/blob/378e5e8a0db18364cd9ec848aa81f5eded508da5... will postpone the switch to the saved session's last active file until after both the session and the file specified on the command line are loaded. But this way, the specified file will _not_ become the active one.
I think, the expected behavior would be that the file specified on the command line does become the active one. Note that this is also the current behavior if Geany is already running (and thus the session need not be loaded anymore).
This issue could be fixed e.g. by doing an immediate call instead, say ```c switch_to_session_page(NULL); ``` But maybe there is a good reason for postponing the call (I am not aware of).
I don't remember exactly but there definetely a good reason. Maybe postponing it to wait for other GUI components to be initialized and only then switch the active document once so all other widgets (e.g. symbol tree and similar) are up to date.
https://github.com/geany/geany/pull/3318 tries to fix it.
Closed #3136 as completed.
Thank you. The commit of #3318 indeed fixes the issue. Very nice. I'm closing this report.
github-comments@lists.geany.org