Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361192 - Incorrect parent shell selected when a compare dialog is opened by a dialog
Summary: Incorrect parent shell selected when a compare dialog is opened by a dialog
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 3.8 M4   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-17 17:58 EDT by Remy Suen CLA
Modified: 2011-11-08 06:36 EST (History)
0 users

See Also:


Attachments
Fix v01 (1.17 KB, patch)
2011-10-25 05:23 EDT, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (12.50 KB, application/octet-stream)
2011-10-25 05:23 EDT, Tomasz Zarna CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.