Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356209

Summary: [Compatibility] HandlerUtil.getActiveShell gives me always the parent (Workbench) Shell
Product: [Eclipse Project] Platform Reporter: Thomas Kratz <eiswind>
Component: UIAssignee: Michael Rennie <Michael_Rennie>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ankur_sharma, curtis.windatt.public, emoffatt, Michael_Rennie, pwebster, remy.suen
Version: 4.1   
Target Milestone: 4.2 M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Thomas Kratz CLA 2011-08-30 10:31:45 EDT
Build Identifier: 4.1

If I open a Dialog and hit a key binding I never get the Dialog's Shell.

Reproducible: Always
Comment 1 Remy Suen CLA 2011-08-30 10:45:56 EDT
Looks like Eric added some code to ignore dialogs in our source providers about a year ago for some reasons.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_development&id=ac28b9ac060b5c4837ef5f805ee4a93cd74be180

This block of code isn't present in 3.x's WorkbenchSourceProvider.
Comment 2 Remy Suen CLA 2011-08-30 13:51:01 EDT
Thomas, can you try testing with the changes described in comment 1 reverted?

I don't see anything obviously problematic with it after starting and restarting with one or multiple workbench windows. Also, since that block of code doesn't exist in 3.x I am of the opinion that the code further down is capable of handling an event from a shell that's a dialog.
Comment 3 Michael Rennie CLA 2012-04-12 15:23:23 EDT
*** Bug 351957 has been marked as a duplicate of this bug. ***
Comment 4 Michael Rennie CLA 2012-04-12 15:25:49 EDT
I think this is the link Remy meant to post: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ac28b9ac060b5c4837ef5f805ee4a93cd74be180

I have committed a fix (revert the other changes) to my github branch mrennie/bug356209:

https://github.com/mrennie/eclipse.platform.ui/commit/cedc03cd1a88f56c360b1773374007c7adc86267
Comment 5 Michael Rennie CLA 2012-04-12 15:32:02 EDT
There is also a PDE component to this fix which I have already committed here:

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=b3096ff597337a32328ec7ec904adbeac2dc6057
Comment 6 Paul Webster CLA 2012-04-16 14:10:40 EDT
(In reply to comment #4)
> 
> https://github.com/mrennie/eclipse.platform.ui/commit/cedc03cd1a88f56c360b1773374007c7adc86267

I've released this to master, could you check it out?

PW
Comment 7 Michael Rennie CLA 2012-04-17 12:55:59 EDT
(In reply to comment #6)
> (In reply to comment #4)
> > 
> > https://github.com/mrennie/eclipse.platform.ui/commit/cedc03cd1a88f56c360b1773374007c7adc86267
> 
> I've released this to master, could you check it out?
> 
> PW

looks good.

Steps to test:
1. open the launch configuration dialog in host workspace
2. activate PluginSpy (Alt+Shift+F1) in launch dialog
3. notice it talks about whatever the active view of the workbench is - BAD, should reference the shell of the lcd + help, etc
4. open the launch configuration dialog in target workspace (with the latest from platform ui master)
5. activate the PluginSpy
6. notice it talks about the lcd + help etc - OK
Comment 8 Curtis Windatt CLA 2012-05-01 12:32:48 EDT
Verified in I20120430-1800.