Bug 378330 - Closing a perspective first creates all parts
Summary: Closing a perspective first creates all parts
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2012-05-03 04:42 EDT by Dani Megert CLA
Modified: 2012-11-22 19:18 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2012-05-03 04:42:44 EDT
I20120502-1800.

Closing a perspective first creates all not yet realized parts. This makes no sense and is a regression compared to 3.8.
Comment 1 Eric Moffatt CLA 2012-05-03 14:05:46 EDT
Just tried this in I20120502-1800 and don't see this effect...started with a fresh window with the Java perspective open, added a breakpoint to ContributedPartRenderer and closed the perspective. The breakpoint never fired...

Can you give me the steps you used to determine this ?
Comment 2 Eric Moffatt CLA 2012-05-03 14:44:19 EDT
I see this now...it's caused by the PartService's 'hidePart' handling. This is the code that tries to select a new tab if you close the one for the currently selected tab.

On a perspective close we, of course, call removeGui on the MPerspective which eventually winds its way down to the "Problems' View. There's a widget listener in CompatibilityPart that then fires a 'partClosed' event and eventually leads to the code that selects a new part to show in the same stack as the problems view...leading to the bogus creation of the JavaDoc view...
Comment 3 Eric Moffatt CLA 2012-05-03 16:12:12 EDT
commit 5a8bcce23595f552332831e75ff921a185623eef

This is a HACK !! When 'closePerspective' is called I put a new tag 'PerspClosing' onto the affected perspective...then in the PartService's 'hidePart' handling I check to see if the part being hidden is in a perspective that's 'PerspClosing' and, if so, inhibit the code that was selecting a new element in the stack...

The reason I haven't turned the tag into a constant is that we can't really define it in WorkbenchPage because it's used in the PartService and we don't want to link the two...

I've opened bug 378408 to track the technical debt we're incurring here...
Comment 4 Eric Moffatt CLA 2012-05-03 16:13:12 EDT
Note that Close All Perspectives can still exhibit this behavior...at this point the solution to that would be to remove the operation...
Comment 5 Dani Megert CLA 2012-05-04 03:34:15 EDT
In addition, something is very fishy with the fix (4.2-I20120503-1800, Windows 7): sometimes File > Exit shows the dialog and sometimes it doesn't using these steps.

1. start new workspace
2. File > Exit
==> no dialog! (sometimes)

1. start new workspace
2. click 'Link with Editor' in the Package Explorer
3. File > Exit
==> dialog (sometimes)
Comment 6 Dani Megert CLA 2012-05-04 03:36:08 EDT
(In reply to comment #5)
> In addition, something is very fishy with the fix (4.2-I20120503-1800, Windows
> 7): sometimes File > Exit shows the dialog and sometimes it doesn't using these
> steps.
> 
> 1. start new workspace
> 2. File > Exit
> ==> no dialog! (sometimes)
> 
> 1. start new workspace
> 2. click 'Link with Editor' in the Package Explorer
> 3. File > Exit
> ==> dialog (sometimes)

Sorry, this wasn't meant for this bug.
Comment 7 Dani Megert CLA 2012-05-04 03:45:44 EDT
Verified in 4.2-I20120503-1800.


> Note that Close All Perspectives can still exhibit this behavior...at this
> point the solution to that would be to remove the operation...

Filed bug 378440 for that.
Comment 8 Eric Moffatt CLA 2012-05-07 10:25:01 EDT
As per Dani's comment...