Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 100737 - [WorkbenchParts] Part not activated when Part's control is activated
Summary: [WorkbenchParts] Part not activated when Part's control is activated
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 3.1 RC4   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-19 17:22 EDT by Randy Hudson CLA
Modified: 2005-06-23 14:13 EDT (History)
6 users (show)

See Also:


Attachments
Naive patch to "PartPane" (589 bytes, patch)
2005-06-21 14:05 EDT, Douglas Pollock CLA
no flags Details | Diff
Patch to "WorkbenchPage" (994 bytes, patch)
2005-06-22 10:50 EDT, Douglas Pollock CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Hudson CLA 2005-06-19 17:22:41 EDT
1) In a non-foreground perspective, display the outline view
2) In the foreground perspective, close the outline view
3) Open a GEF Logic example editor
4) Open the outline view in the foreground
5) Click on editorpart, then click on outline's tree control.

The EditorPart still has part activation, even though focus is on the outline's
control.

Reproduced in 0602 and RC3
Comment 1 Randy Hudson CLA 2005-06-19 17:24:14 EDT
Reproduced with the compilation unit editor also.
Comment 2 Randy Hudson CLA 2005-06-19 17:27:06 EDT
This sounds like a blocker.  Keys such as DEL, Cut, CTRL+D, Ctrl+S, anything,
can end up going to any other part and not the one the user just clicked on. For
most workbench parts, there is no save mechanism.  So a delete is a permanent
change. Only editors have save.
Comment 3 Michael Van Meekeren CLA 2005-06-20 08:53:31 EDT
Randy, are you able to recreate this in RC2?
Comment 4 Randy Hudson CLA 2005-06-20 10:53:22 EDT
> Randy, are you able to recreate this in RC2?

Didn't RC2 come between 0602 and RC3?
Comment 5 Michael Van Meekeren CLA 2005-06-20 10:59:27 EDT
Sorry I missed the extra 0602 dates there, I will consider your answer as a
"yes, I humbly submit that whilst I did not try it on RC2, I did in fact try it
on 0602 which is before RC2 so I assume it was broken there as well." <g>
Comment 6 Michael Van Meekeren CLA 2005-06-20 15:01:09 EDT
Paul could you investigate please.  It would be nice to know how long this has
been happening as well.
Comment 7 Paul Webster CLA 2005-06-21 09:32:51 EDT
So far:

This problem seems to have appeared between M7 and RC1.

After you show the outline, click on the part, and then click on the outline,
the editor tab stays blue.

The method clicked in the outline view gets selected in the outline tree, and
the left bar of the editor highlights the method selected.

The editor won't track the outline method selection.  If you select a method
that's not on the screen, you can't see it in th editor.

Keys typed are still getting to the outline view, they select different methods.
 Some of the keystrokes still go to the editor part (like DEL, which in M7 asks
if you want to deleted the outline-selected method, and in RC1 will delete
characters from the last cursor position in the editor).

PW
Comment 8 Michael Van Meekeren CLA 2005-06-21 09:51:37 EDT
need to investigate for RC4, Doug does the last comment about delete going to
the editor and not the Outline mean anything to you?

to be reviewed June 21
Comment 9 Randy Hudson CLA 2005-06-21 10:00:10 EDT
Delete is an accelerator that goes to the global action which forwards to the 
active part. This has been changed for a long time in 3.1 (control's used to 
receive the key in 2.1) so I don't see how the outline could have gotten the 
DEL key in M7 unless it was the active part, or there was some glitch in 
swapping action delegates.
Comment 10 Paul Webster CLA 2005-06-21 10:25:05 EDT
re: comment #9

You're right, in M7 the outline becomes the active part.  By RC1, the editor
stays the active part.

PW
Comment 11 Randy Hudson CLA 2005-06-21 10:48:26 EDT
Oops. duh! Right, the bug wasn't in M7, so DEL key is working exactly as you 
would expect, i.e. it follows active part. (so what is MVM asking about??)
Comment 12 Douglas Pollock CLA 2005-06-21 10:51:09 EDT
Reproduced on Linux GTK+.  Downgrading to major, as this does not cause
"crashes, loss of data, severe memory leak".

I can reproduce this problem with any view.  It is not particular to the Outline
view.

I'm going to try to track down the exact fix that caused this problem.
Comment 13 Douglas Pollock CLA 2005-06-21 11:11:34 EDT
Here is a very rough list of files that might have been involved in this kind of
a change:

internal/EditorAreaHelper.java
internal/EditorList.java
internal/EditorManager.java
internal/EditorReference.java
internal/PageLayout.java
internal/PartList.java
internal/PartPane.java
internal/PartSashContainer.java
internal/PartService.java
internal/PartStack.java
internal/ViewFactory.java
internal/ViewLayout.java
internal/ViewReference.java
internal/ViewStack.java
internal/WorkbenchPage.java
internal/WorkbenchPagePartList.java
internal/WorkbenchPartReference.java
internal/presentations/defaultpresentation/DefaultTabFolder.java
internal/presentations/defaultpresentation/DefaultTabItem.java
internal/presentations/defaultpresentation/EmptyTabFolder.java
internal/presentations/defaultpresentation/NativeTabFolder.java
internal/presentations/util/AbstractTabFolder.java
internal/presentations/util/PresentablePartFolder.java
internal/presentations/util/ProxyControl.java
Comment 14 Randy Hudson CLA 2005-06-21 11:12:59 EDT
If I press DEL in the outline view, and instead, a breakpoint gets deleted, 
that's loss of data.
Comment 15 Randy Hudson CLA 2005-06-21 11:19:06 EDT
Or worse, a user who quickly dismisses confirmation dialogs could delete an 
entire project containing unreleased code by accident.
Comment 16 Douglas Pollock CLA 2005-06-21 13:52:36 EDT
The change appears to be a small piece of the change committed with regards to
Bug 58003.  It's the change in PartPane from revision 1.73 to 1.74.
Comment 17 Douglas Pollock CLA 2005-06-21 14:05:19 EDT
Created attachment 23649 [details]
Naive patch to "PartPane"

Without doing any research on what kind of problems this will cause, this is a
naive fix for this particular problem.	It rolls back one specific part of
change made on May 25, 2005.

I'll take a look at what documentation might be around on why this change need
to be around.  There's none in code, so I'm hoping reading Bug 58003 carefully
might reveal some clues.
Comment 18 Douglas Pollock CLA 2005-06-21 14:07:22 EDT
Nick, MVM: Do either of you know why this change was done?  (note: the 'naive
patch' reverts the change)
Comment 19 Douglas Pollock CLA 2005-06-21 16:16:57 EDT
Roughly, what is happening is that the view's PartPane is cached between
perspectives.  A flag exists, inLayout, that appears to be used as a note as to
whether PartPane is actually visible in the current perspective layout.  The
change in question made it so that -- if the PartPane is not inLayout -- it will
not respond to activation events.

The problem is that hiding a view sets inLayout to false, while showing a view
does not set inLayout to true.  inLayout starts as true, and it seems that it
can only become true again during a perspective switch.

I would assume that setting the flag in showView would be another way of fixing
this problem, but for some reason that doesn't seem to work.  I'll have to look
at this more.


To get into this state, the view in question must exist in another (open)
perspective.  At this point, simply opening the view will have this effect.
Comment 20 Douglas Pollock CLA 2005-06-22 10:50:18 EDT
Created attachment 23734 [details]
Patch to "WorkbenchPage"

I believe this is a better approach to take, and should be our approach for 3.1
RC4.  This being said, I feel this change is high risk and will require
significant testing.  Unfortunately, we don't have any good alternatives.

Stefan Xenos is on vacation, and he's the only that knows why this particular
fix was required.  So, reverting it naively (previous patch) may re-introduce a
major bug.  Similarly, we don't know if there is a specific reason why inLayout
should remain false in this case (even though it seems like it should become
true).	The bug is significant enough that it can't be left alone.
Comment 21 Douglas Pollock CLA 2005-06-22 12:13:56 EDT
We've managed to reach Stefan Xenos on vacation.  And, while he is somewhat
computer impaired at the moment, the patch to WorkbenchPage sounds like the
right thing to him.

He explained a bit about what the inLayout flag was originally intended to do. 
There were cases where activate events could arrive for a part after it had been
marked for closure.  This would cause the part to activate in the middle of the
process of closing, and this could cause exceptions.  It also hurt performance
on perspective switching.


We have put together a patched version of the org.eclipse.ui.workbench plug-in
from N20050622-0010
(http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-ui-home/gir/org.eclipse.ui.workbench_3.1.0.jar).
 Please try installing the patch.  For those with more time, please take a
moment and try to break it.
Comment 22 Michael Van Meekeren CLA 2005-06-22 15:39:49 EDT
I did find one case where a view always opens as a fastview even after I have
placed it back in the "regular" workbench layout, then closed it and did
something that would make the view be shown.

Logging bug 101335 for this, which is not likely related to this bug.
Comment 23 Michael Van Meekeren CLA 2005-06-22 16:27:11 EDT
Found and logged a second bug (bug 101346) while testing this.

Doug please apply this patch to head as I think both bugs are not related to
this and we need a build to test more on.  I will verify that this is good
tomorrow at 10am, if not we can pull it out then.
Comment 24 Douglas Pollock CLA 2005-06-22 16:33:20 EDT
I have tried the scenarios Stefan laid out.  Closing all editors doesn't appear
to send extraneous activation events, and switching perspectives with detached
views doesn't appear to either.  Of course, I have a feeling that this behaviour
might vary from platform to platform.
Comment 25 Douglas Pollock CLA 2005-06-22 16:40:33 EDT
Committed patch to CVS.  Marking as FIXED.
Comment 26 Douglas Pollock CLA 2005-06-23 14:13:14 EDT
Verified in I20050623-1200, GTK+.