Skip to content

Improve focus handling in Connect dialog - #3859

Open
softins wants to merge 2 commits into
jamulussoftware:mainfrom
softins:connectdlg-focus-server
Open

Improve focus handling in Connect dialog#3859
softins wants to merge 2 commits into
jamulussoftware:mainfrom
softins:connectdlg-focus-server

Conversation

@softins

@softins softins commented Aug 3, 2026

Copy link
Copy Markdown
Member

Short description of changes

Deselects any selected server in the server list when the Server Address combo box gains focus. This ensures that clicking
Connect when the Server Address has focus will connect to the expected server, even if a server had previously been
selected in the server list.

CHANGELOG: Client: make sure Connect uses the expected server if Server Address box is selected.

Context: Fixes an issue?

Fixes #3857

Does this change need documentation? What needs to be documented and how?

No

Status of this Pull Request

Ready to merge. Tested on Linux and Windows..

What is missing until this pull request can be merged?

Nothing

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@softins softins added the bug Something isn't working label Aug 3, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Aug 3, 2026
@softins softins added the backport_required A change to main that needs fix on an existing release. label Aug 3, 2026
@softins softins added this to the Release 4.0.0 milestone Aug 3, 2026
Comment thread src/connectdlg.cpp
if ( obj == cbxServerAddr && event->type() == QEvent::FocusIn )
{
// remove selection in the server list (if any)
lvwServers->clearSelection();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually like this.

The problem is that hitting connect when focus was in the Server text box should use that value.

Moving focus from the server list to any other field should have no effect on the selected server -- at that point, you have no idea of the user intent.

Why should moving to one field (Server) behave differently from another (Filter)?

@softins softins Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that hitting connect when focus was in the Server text box should use that value.

Exactly. That's what @dingodoppelt was saying in #3857, and what does not always happen currently.

Moving focus from the server list to any other field should have no effect on the selected server -- at that point, you have no idea of the user intent.

Except that if the field they have clicked on is the Server Address combo box, it's reasonable to assume that it contains the server they want to connect to.

Why should moving to one field (Server) behave differently from another (Filter)?

Because by moving to the Server Address field, the user is desiring to use its value. The connect button won't use that value if there is still a server selected in the list box.

Currently, the only ways to deselect the selected server in the server list are either to go to a different directory, or to edit or change the value in the Server Address field. Just selecting the Server Address field when it already contains the desired value from before does not currently allow its value to be used, if there is still a server selected in the list. This PR fixes that by interpreting putting focus on the Server Address field as intent that its value should be used when connecting, and therefore deselecting any server selected in the list.

If you need convincing, try this version out and see!

@pljones pljones Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be far better just to check focus correctly, rather than changing the natural behaviour of a widget (OK - whichever, it's changing Qt's implementation).

Being able to tab from the server list into the Server field would make more sense than this -- and that action shouldn't change the item selected. If you carry on tabbing back to the server list, the same server should be selected.

The change proposed here would break that. It's prioritising mouse navigation over keyboard navigation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be far better just to check focus correctly, rather than changing the natural behaviour of a widget (OK - whichever, it's changing Qt's implementation).

The problem is, by the time the Connect button click is being processed, I believe that button has focus, and you have lost the information about which widget had focus previously.

It's not "changing QT's implementation", it's making the perfectly reasonable UX design decision that the user, by choosing to select the Server Address box, is implying that that is now what they are interested in, and are no longer interested in the server they had previously clicked on in the list, so it can be deselected. That is already the behaviour if the user changes what is in the Server Address box. But they might not want to, if it already contains the desired server.

Being able to tab from the server list into the Server field would make more sense than this -- and that action shouldn't change the item selected. If you carry on tabbing back to the server list, the same server should be selected.

The Tab behaviour is a separate issue that warrants investigation and its own PR. Currently Tab moves between servers in the list instead of moving from the server list to the combo box.

The change proposed here would break that. It's prioritising mouse navigation over keyboard navigation.

No, the keyboard navigation is already broken. This PR doesn't change that, it just addresses and improves a specific shortcoming of the current UX design.

@github-project-automation github-project-automation Bot moved this from Triage to Waiting externally in Tracking Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport_required A change to main that needs fix on an existing release. bug Something isn't working

Projects

Status: Waiting externally

Development

Successfully merging this pull request may close these issues.

Connect button in connect dialogue doesn't connect to the expected server

2 participants