Skip to content

Conversation

Ansariel
Copy link
Contributor

@Ansariel Ansariel commented May 7, 2025

This fix merged in #4038 is wrong as well as the explanation to it. The duplicated request stems from the fact that the search editor "location" triggers the same commit callback as the "Search" button, which happens as soon as the search editor loses focus. All that change does is reducing the time between the execution of the callbacks from the search editor and the button (the callback from the button is now called immediately as the button is pressed and not when the mouse button is released), the search is still triggered twice. That only works purely by coincidence because the second search request is sent before the result of the first request is received, Effectively it is the same if you click the search button fast (as in press and release the mouse button quickly).

The actual cause is - as already pointed out - the slightly delayed execution of the second search request after the result of the first request has already been received: A result containing at least one entry will select the an entry in the result list, which then updates the search editor. The then executed search request will use the updated text in the search editor and will then obviously return only the one entry with the exact match.

This fix causes the actual issue by removing the unnecessary commit callback for the search editor and instead fixing the incorrect setting of the default button, which is applied to the floater. However, the panel actually evaluating the default button in its LLPanel::handleKeyHere method is layout_panel_4, which is the parent of all tracking-related controls. Removing the commit callback for the search editor and fixing the correct default button handling will now properly invoke the commit callback from the default search button without sending a duplicate request. This also fixes the unexpected behavior of actually triggering a search when the search editor loses focus.

Also changed it so the pointer to the widgets is directly passed into the LLPanel::setDefaultBtn method as passing the name will cause a getChild XUI lookup each time it is called - and it is called each time you enter anything in the search editor.

@github-actions github-actions bot added the c/cpp label May 7, 2025
Copy link
Contributor

@marchcat marchcat left a comment

Choose a reason for hiding this comment

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

Thank you, @Ansariel!

@marchcat marchcat merged commit bb9adf3 into secondlife:develop May 7, 2025
6 checks passed
@marchcat marchcat linked an issue May 7, 2025 that may be closed by this pull request
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2025
@Ansariel Ansariel deleted the develop-map-search-fix branch May 29, 2025 11:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

World Map Find removing results undesirably

2 participants