Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350016 - Bad focus behavior by programmically give focus to a view breaks selection provider
Summary: Bad focus behavior by programmically give focus to a view breaks selection pr...
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.5 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 04:34 EDT by Arnaud MERGEY CLA
Modified: 2011-11-07 05:20 EST (History)
0 users

See Also:


Attachments
snippet to reproduce the issue (26.97 KB, application/octet-stream)
2011-06-22 04:38 EDT, Arnaud MERGEY CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arnaud MERGEY CLA 2011-06-22 04:34:46 EDT
Tested with RAP 1.4 RC3

I noticed a strange behavior in my application, I have a job that programmatically open/activate a view when a job is finished.
Sometimes, the job is too short, so the progress dialog is not displayed. In this case it seems to break selection provider, as the focus remains on the previously activated view.

I have tested in RCP, it works as expected.

I can provide a snippet to reproduce the issue. (The snippet is single sourced, so it can be also checked against RCP)

-launch snippet.focus application
-click on "Long running" action on coolbar
- "View" takes focus.
- right-click on some item in "OtherView", you should see "My Action for current selection" menu.
-then click on "Short running" action on coolbar
-"View" takes focus.
- right-click on some item in "OtherView", the menu does not appear, as the view OtherView does not take focus. The only way to have it taking focus is to click on the header tab of the view.
Expected: we should have "My Action for current selection" menu as in RCP.

I noticed this issue only occurs if the progress dialog is not shown. If the dialog is shown, it works as expected, so as a workaround I put a Thread.sleep(1000) in the job, in order to have the dialog shown.
Comment 1 Arnaud MERGEY CLA 2011-06-22 04:38:30 EDT
Created attachment 198378 [details]
snippet to reproduce the issue
Comment 2 Ivan Furnadjiev CLA 2011-06-22 09:34:20 EDT
Reproducible with CVS HEAD too.
Comment 3 Ivan Furnadjiev CLA 2011-11-07 05:20:27 EST
I can't reproduce it anymore with current CVS HEAD. Probably this was fixed by the UICallBack rework (Bug 344989) or latest context menu fixes (bug 362243).