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

Bug 56286

Summary: [ViewMgmt] (regression) Change in which view is on top when views stacked in a folder as of I0325
Product: [Eclipse Project] Platform Reporter: Pat McCarthy <patmc>
Component: UIAssignee: Stefan Xenos <sxenos>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: eclipse, n.a.edgar
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Pat McCarthy CLA 2004-03-25 22:12:40 EST
Given: 
// Bottom : Resource Navigator and Progress view 
IFolderLayout bottom =
  layout.createFolder("topLeft", IPageLayout.BOTTOM, 0.3f, editorArea);
bottom.addView(ID_PROGRESSVIEW);
bottom.addView(IPageLayout.ID_RES_NAV);	

Prior to 0325 this would always result in the Progress view being visible with 
the Navigator view underneath.  As of I0325 the Navigator view end up on top 
when the perspective involved is opened for the first time.

If the views involved are closed and the perspective reset the expected 
order/visibility returns. I do not see similar behavior with other 
perspectives, just mine.  But I can get the same results again and again with a 
fresh workspace.
Comment 1 Nick Edgar CLA 2004-03-26 13:42:46 EST
Sounds like a focus problem.  When a perspective is first opened, the first view
in the first folder should be activated and get focus.

Comment 2 Pat McCarthy CLA 2004-03-26 13:50:31 EST
There is only one view in the first folder and it does get focus.

What I noticed is that there was a change in what was the top view in the 
second folder. It used be the first view added, now the second view, but only 
on initial display of perspective.  If I fiddle enough it goes back to first 
view in folder on top.  I can't see it happening in other perspectives, but the 
views in my folder are eclipse views (Progress, Navigator).

A nit maybe - but I noticed so I shared.
Comment 3 Nick Edgar CLA 2004-03-26 14:28:35 EST
So it may not be a focus problem.  But the first view added to a folder should
still be the topmost on initial creation.
Comment 4 Kim Horne CLA 2004-03-29 16:50:32 EST
There may be another symptom of this problem after perspective initialization. 
I've got a folder with two views.  I have a breakpoint in one of those views.  I
shut down eclipse with that view having focus (on the top of its stack).  Upon
restarting my breakpoint is hit, but the view that had focus on shutdown (the
top view in the stack) is no longer the top view.  In fact, for every stack of
views I try the leftmost view is brought to the top on startup irregardless of
the previous state.

Based on the fact that my breakpoint is being hit it seems like the workbench is
trying to restore the proper view but then it gets sidetracked somehow...either
that or lazy view initialization is broken again.

Comment 5 Nick Edgar CLA 2004-04-01 14:50:50 EST
Verified Kim's observation in I20040330:
- open 3 views in the same folder
- active the 2nd one
- activate some other view not in the same folder
- shutdown/restart
- the 1st view in the folder is selected (wrong)

Also, it only remembers the active part correctly if it's the first in its folder.
Comment 6 Stefan Xenos CLA 2004-04-21 00:27:36 EDT
This is almost certainly due to the bug in PartTabFolder.showPart(...) that I
mentioned in bug 58926. These might be duplicates.
Comment 7 Stefan Xenos CLA 2004-04-30 17:54:25 EDT
All items here have been fixed in head.

However, there will be a lot of change in this area of the code before M9, so
regressions are possible. The problems reported in comment 4 and comment 5 were
fixed in the merge of EditorWorkbook and PartTabFolder. 

The original bug was not fixed explicitly, but it is now working as a
side-effect of some changes to the initialization code. The logic for selecting
the initial tab should really be made more explicit in the future.