Bug 415721 - [WorkbenchParts] Accessibility - Keyboard focus lost after search
Summary: [WorkbenchParts] Accessibility - Keyboard focus lost after search
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.3.2   Edit
Assignee: Dani Megert CLA
QA Contact: Wojciech Sudol CLA
URL:
Whiteboard:
Keywords: accessibility
: 412515 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-22 18:11 EDT by ALOK MANJREKAR CLA
Modified: 2013-12-10 03:48 EST (History)
6 users (show)

See Also:


Attachments
Alternative patch for the 'first search' focus issue (1007 bytes, text/plain)
2013-11-20 12:28 EST, Daniel Rolka CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ALOK MANJREKAR CLA 2013-08-22 18:11:33 EDT
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.
Comment 1 Dani Megert CLA 2013-08-23 03:17:47 EDT
Works in 3.x.
Comment 2 Daniel Rolka CLA 2013-11-20 12:28:37 EST
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
Comment 3 Dani Megert CLA 2013-11-21 08:01:31 EST
(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.
Comment 4 Paul Webster CLA 2013-11-21 08:48:38 EST
(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
Comment 5 Dani Megert CLA 2013-11-21 08:50:28 EST
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
Comment 6 Dani Megert CLA 2013-11-21 08:53:06 EST
*** Bug 412515 has been marked as a duplicate of this bug. ***
Comment 7 Noopur Gupta CLA 2013-12-10 03:48:02 EST
Verified in build: M20131204-0800 on Windows 7 and Lubuntu 12.04.
It was not reproducible with 4.3 or later on Lubuntu.