DESCRIPTION

Bug 401632 - minimized parts should be reported as invisible

Change-Id: I119afb5a0d7cd2b572833c5e4b958b37cb0e47dc
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2016-02-24 21:57:24.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2016-02-24 21:57:30.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8382/

-------------------------------------
author: Brenden Conley
date: 2016-02-24 22:21:02.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/8382/ : SUCCESS

-------------------------------------
author: Jayvion Booth
date: 2016-02-24 22:27:19.000000000

Patch Set 3:

> Unfortunately it does not work: instead of being slow, it's now
 > unusable

 That was this "active" flag Brian mentioned.

 > > I hate to say it, but I think we need some unit tests to verify
 > these conditions.
 > 
 > +100

Related tests were disabled years ago, I have no insights why, but I've re-enabled some of them which fail without the fix.

I've also enabled some other tests in the next commit, they do not test minimized state however.

-------------------------------------
author: Teagan Marsh
date: 2016-02-25 04:10:03.000000000

Patch Set 3:

(2 comments)

Line:484, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> This code doesn't seem quite right.

1. I think only MPartStacks get tagged with MINIMIZED or MINIMIZED_BY_ZOOM, so checking isMinimized() for anything else is a no-op. I guess it doesn't hurt to check though.

2. The values we're interested in checking are on the MPlaceholders, so I think we need to check isMinimized(element) and not isMinimized(part).

2. MParts/MPlaceholders in a minimized MPartStack continue to have visible=true.  But MParts/MPlaceholders in an MPartSashContainer have visible=false.

I expected to see something like:

> if(parent instanceof MPartStack && ((MPartStack)parent).getSelectedElement() != element) {
>     return false;
> }
> if(isMinimized(parent) || isMinimized(element)) {
>     return false;
> }
> return element.isVisible();

(which passes the tests)

Line:493, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> I get very inconsistent results changing the visible state using the model spy: 

- the content disappears for a part in a MPartStack, but the content reappears if I switch to and from another view (admittedly this situation doesn't reach here);

- the content never re-appears for a standalone view (a part embedded directly in an MPartSashContainer)

-------------------------------------
author: Jayvion Booth
date: 2016-02-29 19:25:52.000000000

Patch Set 3:

(2 comments)

I've updated the patch set according to Brian's comments.

Line:484, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> Done

Line:493, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> Brian, sorry, I cannot follow. What do you do with the model spy exactly? Are you talking about element.isVisible() flag in general or about this concrete change causing some inconsistencies? Is this something for an additional bug report?

-------------------------------------
author: Teagan Marsh
date: 2016-02-29 20:23:21.000000000

Patch Set 3:

(1 comment)

Line:493, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> I was musing about whether isVisible() is sufficient and applicable.  I was using the Model Spy to test the effect of toggling the visible state on parts to see if this code would do the right thing; I was seeing inconsistent behaviour for parts in the window's Shared Elements. But 'element' should always be the placeholder (for a shared part), so these issues are moot.

-------------------------------------
author: Gerrit Code Review
date: 2016-03-01 20:45:55.000000000

Change has been successfully merged into the git repository by Jayvion Booth

-------------------------------------
