This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 427037 - Switching perspectives hides minimized stacks in Detached Windows
Summary: Switching perspectives hides minimized stacks in Detached Windows
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.3.2   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-30 14:38 EST by Eric Moffatt CLA
Modified: 2017-09-13 16:28 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Moffatt CLA 2014-01-30 14:38:41 EST
Found while testing 4.3.2.M20140129-0800...

To Repro:

Have two perspectives open
In on of the perspectives drag a stack out to make a Detached Window
Drag another stack into the DW beside the first one
Minimize one of the stacks

Now switch to the other perspective and back...The minimized stack is no longer showing in the trim.

This is almost certainly a mismatch in the code for showing / hiding minimized stacks on perspective switches; we're obviously hiding the trim stacks in the DW for the old perspective and not showing it on the switch back. Since the DW's themselves are going to be hidden the fix may well be to remove the code that's hiding them now rather than adding more code to show them again (but this will have to be tested.)
Comment 1 Eric Moffatt CLA 2014-01-30 15:48:57 EST
This turns out to be a layout issue, resizing the DW causes trim stacks to appear. There is already code that lays out the main shell after processing so I think I should be making a list from any shells affected and laying out any shell for which a trim stack has been either shown or hidden.
Comment 2 Eric Moffatt CLA 2014-01-31 09:44:09 EST
Gerrit patch:

  https://git.eclipse.org/r/21389

Where we used to only lay out the 'main' shell after showing trim stacks this patch maintains a list of shells for which trim visibility has been changed and performs layouts where necessary.
Comment 3 Dani Megert CLA 2014-02-05 06:32:17 EST
This is quite  a corner case and broken since 4.2.1 (worked in 4.2). At this point I would not touch this code.
Comment 4 Paul Webster CLA 2014-02-05 06:57:19 EST
I'd re-direct this fix to 4.4 M6 then please.

PW
Comment 5 Dani Megert CLA 2014-02-05 07:06:40 EST
(In reply to Paul Webster from comment #4)
> I'd re-direct this fix to 4.4 M6 then please.
> 
> PW

Can you test on 4.4 M5? The whole MinMax code changed in 4.4 and it looks like this bug here is fixed.
Comment 6 Dani Megert CLA 2014-02-06 09:17:47 EST
(In reply to Dani Megert from comment #5)
> (In reply to Paul Webster from comment #4)
> > I'd re-direct this fix to 4.4 M6 then please.
> > 
> > PW
> 
> Can you test on 4.4 M5? The whole MinMax code changed in 4.4 and it looks
> like this bug here is fixed.

I tested again on N20140205-2000 and the bug is gone in 4.4, hence marking as WONTFIX for 4.3.2.
Comment 7 darrel karisch CLA 2017-09-13 16:28:27 EDT
There is a much simpler fix than Gerrit patch https://git.eclipse.org/r/21389

Merely check that the immediate window parent of the MToolControl is equal to the window of the perspectiveStack before setting ToolControl.setToBeRendered(false) in subscribeTopicSelectedElement method.  

The Gerrit patch is a reactive fix to what was broken when the perspective was deselected.  It is better that we prevent breaking the perspective detached window in the first place, as we see here...

... subscribeTopicSelectedElement(...) {
...
        // Hide any minimized stacks from the old perspective
        if (event.getProperty(EventTags.OLD_VALUE) instanceof MPerspective) {
            MPerspective oldPersp = (MPerspective) event.getProperty(EventTags.OLD_VALUE);
            String perspId = '(' + oldPersp.getElementId() + ')';
            for (MToolControl tc : tcList) {
                if (tc.getObject() instanceof TrimStack && tc.getElementId().contains(perspId)
                        && getWindowOfElement(tc) == window) {
                    TrimStack ts = (TrimStack) tc.getObject();
                    ts.showStack(false);
                    tc.setToBeRendered(false);
                }
            }
        }
...
}
private MWindow getWindowOfElement(MUIElement e) {
    while (e != null && !(e instanceof MWindow)) {
        e = modelService.getContainer(e);
    }
    return (MWindow)e;
}

(In reply to Eric Moffatt from comment #2)