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

Fix emission of document-activate signal and various related GUI glitches #3870

Closed
wants to merge 1 commit into from

Conversation

techee
Copy link
Member

@techee techee commented May 11, 2024

PR #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.

…ches

PR geany#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 geany#3684.
@techee techee added the bug label May 11, 2024
@techee
Copy link
Member Author

techee commented May 11, 2024

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

@techee techee added the lsp Related to LSP API and plugins label May 11, 2024
@techee techee added this to the 2.1 milestone May 11, 2024
@b4n
Copy link
Member

b4n commented May 31, 2024

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)

@b4n
Copy link
Member

b4n commented May 31, 2024

(I think I have a fix, but I need to do more testing and it won't happen tonight)

@b4n
Copy link
Member

b4n commented Jun 1, 2024

@techee alternate (more complex, but possibly more through) fix available in #3891

@techee
Copy link
Member Author

techee commented Jun 2, 2024

Closing in favor of #3891.

@techee techee closed this Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp Related to LSP API and plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong filename in titlebar after launch
2 participants