PR https://github.com/geany/geany/pull/3267 removed the special handling of the situation when no tab change happens after setting an active document after session load. This happens in the situation where
1. There's just a single document 2. Depending on the tab opening logic, the active tab saved into the session file corresponds to the already active tab
This patch tries to restore the previous behavior where switch-page" was synthetically emitted in such situations.
Fixes #3684. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3870
-- Commit Summary --
* Fix emission of document-activate signal and various related GUI glitches
-- File Changes --
M src/document.c (16)
-- Patch Links --
https://github.com/geany/geany/pull/3870.patch https://github.com/geany/geany/pull/3870.diff
@kugel- Does the patch look OK to you? I restored the signal emission inside the `document_show_tab_idle()` callback which is the function that gets called when opening session files where this behavior is desired.
It's a bit sad to have this in `document_show_tab_idle()` which is not a name particularly specific to the startup -- although it is in practice.
More importantly, this doesn't handle the case where you close everything, create a new document (untitled), *do not touch it*, and open a real one: the untitled gets closed, and the real one doesn't get notified. I'm not sure what the right fix is here, because it's not as simple as changing the condition in `show_tab_cb()`: doing it in `document_show_tab()` works, but it also notifies in other situations that are not required (like e.g. *save all*). I didn't yet find a good solution (but didn't spend so much time on this either)
(I think I have a fix, but I need to do more testing and it won't happen tonight)
@techee alternate (more complex, but possibly more through) fix available in #3891
Closing in favor of https://github.com/geany/geany/pull/3891.
Closed #3870.
github-comments@lists.geany.org