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

A release of a click on the tab-title of a plugin-tab in the sidebar should put the content of the tab in focus #1320

Closed
ralf3u opened this issue Mar 24, 2024 · 6 comments

Comments

@ralf3u
Copy link

ralf3u commented Mar 24, 2024

Behavior in the editor
click in the editor on a tab-title
result: the content of the tab is in focus, how it should be, what can be tested with the arrow-up/down-key of the keyboard

Behavior of the Documents-tab in the sidebar
click in the sidebar on the tab-title of the Documents-tab
result: the content of the Documents-tab is in focus, how it should be, what can be tested with the arrow-down-key of the keyboard

Behavior of the Preview-tab in the sidebar
(the Preview-tab ist part of the plugin Preview: https://github.com/xiota/geany-preview)
click in the sidebar on the tab-title of the Preview-tab
result: the content of the Preview-tab is NOT in focus, what can be tested with the arrow-up/down-key of the keyboard when a very long webpage is shown in the Preview-tab

Behavior of the Files-tab in the sidebar (the Files-tab ist part of the plugin File Browser)
click in the sidebar on the tab-title of the Files-tab
result: the content of the Files-tab is NOT in focus, what can be tested with the arrow-up/down-key of the keyboard; after a release of a click in the tab-title of the Files-tab the first tool of the toolbar is in focus that is located in the Files-tab

Possible problem
it could be that the problem in Preview is that a not existing toolbar is in focus by default after a release of a click on the tab-title of the Preview-tab, like on the Files-tab, because if I press 1x the arrow-down-key, then the content of the Preview-tab is in focus

History
This issue is based on the knowledge of xiota/geany-preview#15.

System
Lubuntu 23.10
Geany 1.38

@ralf3u
Copy link
Author

ralf3u commented Mar 25, 2024

Can you handle this issue or should I report it upstream to the GTK developers?

@elextr
Copy link
Member

elextr commented Mar 25, 2024

This report should be to https://github.com/xiota/geany-preview, it is not part of the Geany project.

@elextr elextr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 25, 2024
@ralf3u
Copy link
Author

ralf3u commented Mar 25, 2024

The issue is about the behavior of any plugin-tab in the sidebar. Plugins have no influence on the behavior about the release of a click on the tab-title, so it belongs to Geany.

@elextr
Copy link
Member

elextr commented Mar 25, 2024

To be clear, Geany does not know anything about the existence of any plugin or the contents of any tabs it adds to Geany notebooks, even plugins included in the Geany project itself. Therefore plugins are entirely responsible for the behaviour of their UI. Plugins should connect to the relevant signal eg "switch-page" or "focus-tab" or "clicked" on the tab or whatever and then implement the behaviour they require.

Remember I said elsewhere the tab and the contents are different things, and in standard GTK the tab can be focussed instead of the content by clicking it when the page is current. That is the standard behaviour of GTK Notebook, and is how the Documents and Symbols tabs behave. Geany modifies it for the editor notebook to move the focus by intercepting the signals and returning focus to the content (the editor widget) as well as other actions the click might invoke, and the plugin can do so for its tabs if it wishes.

Geany provides a plugin API and that is all the interaction it has with plugins, it has no knowledge of what a plugin might do or what its UI is. A plugin can add pages to the sidebar notebook using standard GTK calls and techniques without any interaction with Geany as the notebook widget is exposed in the API.

@ralf3u
Copy link
Author

ralf3u commented Mar 25, 2024

Thank you for your explication. OK, the issue does not belong to the Geany project but to the plugin Preview.

Do you know if it is possible to solve the issue in the plugin Preview like this, that after a release of a click on the tab-title of the Preview tab the content of the tab is in focus and not the tab itself?

Plugins should connect to the relevant signal eg "switch-page" or "focus-tab" or "clicked" on the tab or whatever and then implement the behaviour they require.

I have no idea how to program software. Does something exist like "focus-content"?

Thank you for an answer.

@elextr
Copy link
Member

elextr commented Mar 26, 2024

Does something exist like "focus-content"?

In GTK (and most other GUI systems) the concept of "focus" is the widget that is going to get keyboard input, the mouse can move around and point to things before a button click, but there is not a similar capability for the keyboard, a widget has "focus" and does not depend on the position of the mouse. So focus is usually on something in the content, like the search entry in the Symbols tab, or the tree. But you need to know it exists. You can see some of the problems around this even for built-in parts of Geany when the contents change in #3678.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants