geany / geany

A fast and lightweight IDE
https://www.geany.org
GNU General Public License v2.0
3.11k stars 602 forks source link

Feature request: When clicking on a tab-title of the sidebar, the focus should always be set on the content-area of the tab #3966

Open ralf3u opened 3 weeks ago

ralf3u commented 3 weeks ago

Goal When clicking on the tab-title of the sidebar, the focus should always be set on the content-area of the tab. So, it should have exactly the same behavior like clicking on a tab-title of the editor.

Current situation & explication When clicking on a tab-title of the sidebar, the focus is not always on the content-area of the tab (see down below from "Conditions" till "Remark III"), while when clicking on a tab-title of the editor, the focus is always on the content-area of the tab. The reason for this different behavior is: The sidebar uses the GTK default behavior while the editor does not use the GTK default behavior.

Conditions

Steps to reproduce

  1. click in the editor
  2. click in the sidebar on the tab-title Documents
  3. with the mouse: mark the first item from the top (result: the first item is marked)
  4. click in the editor
  5. click in the sidebar on the tab-title Symbols
  6. click in the sidebar on the tab-title Documents
  7. press 1x the arrow-down key on the keyboard (result: the next item is marked; so, that means that the release of a click on the tab-title after 6 made the content-area of the tab in focus)
  8. click in the editor
  9. click in the sidebar on the tab-title Documents
  10. press 1x the arrow-down key on the keyboard

Expectation the next item should be marked

Result nothing visible happens; that means that the release of a click on the tab-title in 9 didn't make the content-area of the tab in focus; so, the behavior after 6 is not the same behavior like after 9; but there is something that happens even if it is not visible: after having pressed 1x the arrow-down key on the keyboard in 10, the focus moves from the tab to the content-area of the tab because if one press again 1x the arrow-down key on the keyboard, then the next item is marked; see also "Remark I" down below

Remark I in 3: instead of the first entry, mark the last entry; then do 4 to 6; then in 7 press 1x the arrow-up key instead of the arrow-down key on the keyboard to mark the item before the last item; then do 8 and 9; then in 10 press 1x or several times the arrow-up key instead of the arrow-down key on the keyboard; there will be no change; one have to press first 1x the arrow-down key (!!) on the keyboard to move the focus from the tab to the content-area of the tab; then press 1x the arrow-up key on the keyboard to mark the second last item

Remark II one can do "Steps to reproduce", but without 8

Remark III in "Steps to reproduce" one need first to click in the editor, then on the tab-tile "Symbols" and then on the tab-title "Documents", so that the release of the click on the tab-title will put the content-area of the tab in focus; but there is also a second possibility to put the content-area of the tab in focus: if the tab-title "Symbols" is active while the editor has focus, and then if one click on the tab-title "Documents"

History I reported the issue already in the year 2021 on the website of the plugin Preview (https://github.com/xiota/geany-preview/issues/15) because to that time I thought that the plugin Preview was the problem. But last week I could reproduce the issue while all plugins were deactivated. That means that not the plugin Preview is the problem, but Geany. Last week I opened at geany the issue #3961 with the title BUG: A release of a click on a tab-title of the sidebar does not put always the content-area of the tab in focus because I was sure that there is a bug in the sidebar.

System Lubuntu 24.04 Geany 2.0

ralf3u commented 3 weeks ago

If this issue will be fixed, maybe it would be good to realize the solution also for the message window, because at the moment sidebar and message window have both the GTK default behavior.

ralf3u commented 3 weeks ago

If this issue will be fixed, maybe it would be good to realize the solution also for the message window, because at the moment sidebar and message window have both the GTK default behavior.

If the issue is fixed in sidebar and message window, then editor, sidebar and message window will have exactly the same behavior: When clicking on a tab-title, the focus will always be on the content-area of the tab.

ralf3u commented 3 weeks ago

I just opened a new issue at gtk: https://gitlab.gnome.org/GNOME/gtk/-/issues/7054 The title of the issue is: When clicking on a tab-title, the focus should ALWAYS be set on the content-area of the tab

b4n commented 2 weeks ago

I didn't try it all, but IIUC the behavior isn't that complex: if the tab is already active, the click focuses the tab's label, otherwise it tries not to move focus and only switch page, focusing whatever was in that tab.

On one hand, I agree that there don't seem to me much use for mouse-focusing the tab label itself for regular tab labels (e.g. ones that don't have interactive elements in them). OTOH, I don't really see in which workflow it's an issue: you don't need clicking the tab again, and if you're focusing the tab with the mouse anyway, won't you use the mouse to interact with the tab's content as well, not caring where the focus actually is 99% of the time? Also note that the tab label also gets focused if there isn't anything focusable in the tab itself. It's unclear where else the focus could land in that case.

Also, there's a visual indication for me (using Adwaita): the tab label has the usual focus marker of a dashed outline.

Finally, note that in the case of Geany itself, you can assign a shortcut for focusing the sidebar, which could potentially help (in case the mouse click is a workaround). It doesn't magically move the focus out of the tab label, but it avoids accidentally clicking the tab and moving the focus.

ralf3u commented 2 weeks ago

If one click on a tab-title of the editor, the content-area of the tab has focus. And that's great. As user I expect that sidebar and message window have exactly this same functioning.

[...] I agree that there don't seem to me much use for mouse-focusing the tab label itself for regular tab labels [...]

That is the point. There is no advantage, just confusion. If there would be much use for mouse-focusing the tab label itself for regular tab labels, then the editor would have the GTK default behavior, like the sidebar and the message window.