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

Bug 361192

Summary: Incorrect parent shell selected when a compare dialog is opened by a dialog
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: CompareAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 3.8   
Target Milestone: 3.8 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix v01
none
mylyn/context/zip none

Description Remy Suen CLA 2011-10-17 17:58:22 EDT
Build id: I20110920-0856

1. Make some changes to a file versioned under Git.
2. Right-click the project > Team > Commit...
3. Double-click the file in the table to open a compare editor.
4. Try to hit ESC twice to cancel both dialogs, you can't. After canceling from the compare dialog, the focus goes to the workbench window and not the commit dialog.

The problem comes from CompareUIPlugin's internalOpenDialog(CompareEditorInput) method. The static getShell() method only ever returns the workbench window's shell. The code should instead retrieve a shell provider from IWorkbench's static getModalDialogShellProvider() method. This will ensure that the compare dialog is parented off of the right shell and allow the focus to be returned to the proper shell after the compare dialog's shell has been closed.
Comment 1 Tomasz Zarna CLA 2011-10-25 05:23:41 EDT
Created attachment 205892 [details]
Fix v01

All credits goes to Remy, I just put up a patch from comment 0. Thx!
Comment 2 Tomasz Zarna CLA 2011-10-25 05:23:43 EDT
Created attachment 205893 [details]
mylyn/context/zip
Comment 3 Tomasz Zarna CLA 2011-11-02 06:11:11 EDT
Fixed with 97174e215a5dcdb7bf682873e42b68ae118ee99f. Available in builds >=N20111102-2000. Thanks again Remy.