**Steps to reproduce** 1. let appear a TXT-document in the editor 2. let appear the sidebar 3. click in the sidebar on a tab-title like `Documents` 4. press Ctrl+O to let appear a dialog, or change the window to a file-manager like for example PCManFM-Qt 5. mark an other TXT-document 6. press enter
**Result** the other TXT-document is active, but the editor is not in focus; the sidebar is still in focus
**Expectation** the editor should be in focus
**Remark** an alternative would be to add a checkbox in the `Preferences`, in `Editor`, in `Features` like: `if the editor is not in focus, the editor will be in focus when opening a document`
**System** Lubuntu 24.04 Geany 2.0
an alternative would be to add a checkbox in the Preferences, in Editor, in Features like:
if the editor is not in focus, the editor will be in focus when opening a document
I think this text is better in the `Preferences`, in `Editor`, in `Features`: `if sidebar or message window have focus, the editor will be in focus when opening a document`
Closed #3958 as completed.
Duplicate of #3531
Duplicate of https://github.com/geany/geany/issues/3531
For me it seems to be that there are two different issues. In the report of 3531 with the title `Geany doesn't get focus` there is this text: `[...] from the FileManager GUI if i click on a .txt file then Geany doesn't get focus, [...]`. In the issue that I opened today, Geany is in focus when opening a document from the file manager, namely – under certain conditions – the sidebar or the message window, but not the editor.
Reopened #3958.
Hmmm, ok, what you are trying to say is that opening a file in Geany simply using the menu (nothing to do with filemanagers or anything) does not switch focus to the editor pane from the sidebar pane which is supposed to be existing functionality. Making it an option is a separate feature request.
Can confirm this is a bug, the editor does not get the focus from the sidebar.
[`document_try_focus()`](https://github.com/geany/geany/blob/30f84de9a5eb477a0898664a0aac941af252fe21...) should be called at the end of opening the document and switching focus to the editor. Not sure why it no longer works.
Making it an option is a separate feature request.
I expressed the idea of an option just in case a developer would have said: "It is OK that the editor is not in focus when opening a document". Personally I'm not interested in an option because I don't see a need. But if someone will ask an option in the future, then maybe those thoughts could be interesting:
Add two checkbox in `Preferences`, in `Editor` in `Features`: `if sidebar has focus, the editor will be in focus when opening a document` `if message window has focus, the editor will be in focus when opening a document` Both checkbox should be checked by default.
Geany is supposed to do what you want, so just leave this as a bug.
If you have a real reason to add an option make it a separate issue, don't confuse this bug issue.
github-comments@lists.geany.org