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).