Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 89910 - [WorkbenchParts] (regression) PartStack does not remember active part when switching among perspectives
Summary: [WorkbenchParts] (regression) PartStack does not remember active part when sw...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Stefan Xenos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-31 18:01 EST by Randy Hudson CLA
Modified: 2005-08-10 01:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2005-03-31 18:01:13 EST
Using 0330, the partstack always activates the first part in the stack and not
the  last activated part.

This is not during shutdown/restart, but just swithing among open perspectives.
Comment 1 Randy Hudson CLA 2005-04-01 14:32:03 EST
Some part stacks are working correctly, and some consistently don't work. Let 
my know if you have trouble reproducing.
Comment 2 Stefan Xenos CLA 2005-04-19 13:37:55 EDT

*** This bug has been marked as a duplicate of 62844 ***
Comment 3 Stefan Xenos CLA 2005-04-19 14:17:51 EDT
Oops. Not a duplicate. bug 62844 relates to order, this relates to activation.
Comment 4 Stefan Xenos CLA 2005-04-19 14:44:19 EDT
To reproduce:

1. reset the java perspective. (Ensure the package explorer is visible)
2. open the resource perspective.
3. show and activate the Hierarchy view
4. switch back to the java perspective

The package explorer is no longer visible, and the hierarchy view is on top.

This appears to be a bug in the activation list. When switching perspectives, it
tries to activate the most-recently-activated part in the new perspective, even
if that part is hidden. 

A better heuristic would be to either activate the most-recently-active part
that is also on top, or to activate the *stack* containing the
most-recently-active part (even if a different part is now active). 

Alternatively, we could skip the whole most-recently-active thing (which
requires some slow data structures) and just pick the top part in the stack that
is geometrically closest to the current focus location.
Comment 5 Stefan Xenos CLA 2005-04-19 14:56:09 EDT
Note: this can be reproduced as far back as 3.0.
Comment 6 Randy Hudson CLA 2005-04-19 16:03:00 EDT
The behavior should be the same as if the perspectives were opened in different 
workbench windows.  In other words, reactivate the part that was last active 
when that perspective was made inactive.

Any other behavior is just wrong, ... WRONG! :-)
Comment 7 Stefan Xenos CLA 2005-04-19 16:59:44 EDT
The reason for the current behavior: If the same part exists in both
perspectives and it was active before the switch, it is supposed to remain
active after the switch. If the java editor has focus and the user switches
perspectives, focus should not move to the problems view just because the
problems view was active the last time that perspective was open.

The interesting use cases are those where the currently-active part is not
visible in the new perspective, and in that case your suggestion of trying to
restore the last active part in the perspective may be good (and would certainly
be more efficient than the current method).

For the moment I've fixed this by ensuring that whenever a perspective is
activated, the topmost part in each stack is brought in front of its peers in
the activation order.
Comment 8 Randy Hudson CLA 2005-04-19 17:14:12 EDT
This is almost equivalent to each perspective having its own activation order, 
and it handles the maintain-active-part-if-possible scenario.

nice.
Comment 9 Stefan Xenos CLA 2005-05-11 00:06:58 EDT
Verified in I20050510-0010
Comment 10 Randy Hudson CLA 2005-08-09 16:23:59 EDT
This is still not working in 3.1.0.
Comment 11 Randy Hudson CLA 2005-08-09 16:30:22 EDT
I think the behavior is working as described in comment 7, but that it's just
not enough. If I have the package explorer active in one perspective, and
breakpoints active in another perspective, I always end up with the console
getting reactivated when switching between the two.

What happens to the activation order of the Package Explorer when switching to a
perspective without the view? Does it automatically get pushed to the bottom?
Comment 12 Stefan Xenos CLA 2005-08-10 01:26:13 EDT
This PR is tracking the issue that can be reproduced by following the steps in
comment 4. It works in 3.1 and not in 3.0. Easily reproduced and easily verified.

If there is also some other problem involving part activation, please file a new
bug. Be sure to describe every focus change and perspective switch from the time
you started Eclipse, and describe the behavior you expect to see. Also describe
the differences between your layout and the default perspective layout. For
example, the default Java perspective does not contain a console view.