Community
Participate
Working Groups
Keyboard focus is lost after search. Search View gets opened to show the results. However focus inside the search view is lost. Steps to repro Open a .java file from the workspace. Select the class name. CTRL + H to launch search. Select scope as workspace or working set (doesnt matter). Hit Enter. The search results show up in the search view, however the focus is lost. To get the focus we need to either click in the Search View, or do CTRL + F7 and activate the Search view again. This is quite inconvenient for a keyboard user.
Works in 3.x.
Created attachment 237593 [details] Alternative patch for the 'first search' focus issue The issue is caused by the following processing flow: 1) Just after starting the Eclipse the 'org.eclipse.search2.internal.ui.SearchView.EmptySearchView' page of the SearchView part is opened as the default one 2) Launching search with the SearchDialog activates the SearchView part as one of the first steps of the search job. During activation the focus is set to the current bookviewpage, to the EmptySearchView in our case 3) When job is done the results are populated to the part (the org.eclipse.search2.internal.ui.SearchView.internalShowSearchPage method). During this phase the empty page is replaced with the proper search results page, but without reseting the focus to the current page (focus still belongs to the EmptySearchView page or some other visible item) It works fine during execution the second search since the proper page is already opened and focus goes to the correct page. It is quite hard to fix on the Eclipse SDK site (lack of plugin feedback to handle). The workaround for the issue has been sent to Gerrit - https://git.eclipse.org/r/#/c/18623/ However I would apply the patch directly in the 'org.eclipse.search' plugin. In my opinion it is safer: the 'Alternative patch for the 'first search' focus issue' attachment
(In reply to Daniel Rolka from comment #2) > However I would apply the patch directly in the 'org.eclipse.search' plugin. > In my opinion it is safer: the 'Alternative patch for the 'first search' > focus issue' attachment What makes you think that the Search view is the only affected view? There's also the 'Classic Search' view and others which probably suffer the same bug.
(In reply to Daniel Rolka from comment #2) > Created attachment 237593 [details] > Alternative patch for the 'first search' focus issue Daniel, what is setting the focus on the results in your usecase when you run the scenario in 3.8? PW
I tested a bit more: actually the problem also happens in 3.x. The key is, that when the search is displayed, it has to switch to another page, e.g. toggle between doing a text and Java search via Ctrl+H. In that respect, I think it's fair to fix it in the Search view. I moved the setFocus() to a more local place though. Fixed in 'master' with http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=9b9921412d58b8c3b2505a317f20e57dcdcb6f37 Fixed in 'R4_3_maintenance' with http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=e4178742642ff51fb63c82b584a827c20ef8007c
*** Bug 412515 has been marked as a duplicate of this bug. ***
Verified in build: M20131204-0800 on Windows 7 and Lubuntu 12.04. It was not reproducible with 4.3 or later on Lubuntu.