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

Bug 320142

Summary: Editors no longer activate when clicking on their tabs
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: bokowski, emoffatt, gheorghe, john.arthorne, pwebster, tom.schindl
Version: 1.0   
Target Milestone: 1.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
ModelServiceImpl patch v1
none
here's my fix
none
improved none

Description Remy Suen CLA 2010-07-16 16:23:27 EDT
1. Open an editor.
2. Activate a view
3. Try to activate the editor by clicking on its tab item.
4. The editor's stack doesn't turn blue.

Regression caused by changes for bug 320100 in StackRenderer between v1.13 and v1.14.

When we query the model service for the active perspective of the part stack, we don't find anything because it is contained within a placeholder so there is no intermediate perspective parent between itself and the window.
Comment 1 Thomas Schindl CLA 2010-07-18 06:09:29 EDT
Copying comment from 308700:

In RC2 I see the opposite effect which is also not really nice when selecting a
Tab with the mouse the editor is not getting focus which means a second click
is needed and this kills productivity by 10 because e.g. the last cursor
position is not restored.

And for the record navigating the TabFolder with the keyboard IS not supported
in 3.x but it is on 4.0 (although this is a nice feature causes problems to decide if the focus should be transfered to the editor area when the tab is selected).

Bogdan, can we somehow know from the TabSelection whether is was selected by keyboard traversal, through the mouse because another tab was closed?

In case we want to keep keyboard support I think the focus shift should happen when the user hits RETURN on the selected tab.
Comment 2 Thomas Schindl CLA 2010-07-18 06:50:21 EDT
To me this is a blocker for RC2
Comment 3 Remy Suen CLA 2010-07-18 18:03:49 EDT
Created attachment 174588 [details]
ModelServiceImpl patch v1

Patch to fix getPerspectiveFor(MUIElement) + associated tests.
Comment 4 Boris Bokowski CLA 2010-07-18 18:06:11 EDT
Created attachment 174589 [details]
here's my fix

Let's see if it is the same fix as Remy's....
Comment 5 Boris Bokowski CLA 2010-07-18 18:09:00 EDT
Remy's tests pass with my fix.
Comment 6 Boris Bokowski CLA 2010-07-18 18:21:22 EDT
Created attachment 174590 [details]
improved

I liked the while(true) / return combination, but not EObjectImpl, or the duplicate code that my previous patch had as well. So here's my suggestion for how to fix the bug. This patch also contains Remy's tests. Remy, +1?
Comment 7 Remy Suen CLA 2010-07-18 18:26:27 EDT
(In reply to comment #6)
> Remy, +1?

+1 from me, attachment 174590 [details]'s implementation is compact and easy to read and understand.

Tests confirmed to be passing on Windows 7 here.
Comment 8 Boris Bokowski CLA 2010-07-18 18:37:14 EDT
Fix is in HEAD now. Paul, we need another build for our test pass. Since we may have people in Europe who can test (e.g. Tom, Stefan), it would be great if you could kick off a build tonight. But no worries if you don't have time, with our new build speed improvements tomorrow morning should be good, too.

I've already updated the map file (only for the code change, not for the new tests).
Comment 9 Thomas Schindl CLA 2010-07-19 10:50:02 EDT
This only fixes the problem when coming from another stack. If you click on different tabs in the editor area it's not fixing the problem!
Comment 10 Remy Suen CLA 2010-07-19 10:51:58 EDT
(In reply to comment #9)
> This only fixes the problem when coming from another stack. If you click on
> different tabs in the editor area it's not fixing the problem!

This is the same problem as bug 320249 then.
Comment 11 Thomas Schindl CLA 2010-07-19 11:09:35 EDT
(In reply to comment #0)
> Regression caused by changes for bug 320100 in StackRenderer between v1.13 and
> v1.14.

Just tried 1.13 and I see the same behavior.
Comment 12 Remy Suen CLA 2010-07-19 11:18:22 EDT
(In reply to comment #11)
> (In reply to comment #0)
> > Regression caused by changes for bug 320100 in StackRenderer between v1.13 and
> > v1.14.
> 
> Just tried 1.13 and I see the same behavior.

Okay, let's close this and use bug 320249 for this problem then.