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

Bug 355560

Summary: [Intro] Welcome screen gets pushed to the right side unless Problems view is on top
Product: [Eclipse Project] Platform Reporter: Julia Perdigueiro <julia.perdigueiro>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3 CC: daniel_megert, ericc, jugujoo, markusb, pwebster, remy.suen
Version: 3.7   
Target Milestone: 3.8 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Julia Perdigueiro CLA 2011-08-23 15:10:05 EDT
Build Identifier: I20110613-1736

When you have the problems view available on your workbench but not on top at its area, and get the welcome screen maximized, if you reopen the workbench the welcome screen is pushed to the right without any user interaction.

If the problems view is on top at its area, this does not happen.

Reproducible: Always

Steps to Reproduce:
1. Open Eclipse (I tried with the PDE version).
2. Make sure you have the problems view available on your workbench, but make some other view be on top at the same area the problems view is at.
3. Open the welcome screen and maximize it.
4. Close Eclipse.
5. Open Eclipse again, using that same workspace as before.
6. The welcome screen is opened maximized, but if you wait a little while it gets pushed to the right side by itself.
Comment 1 Remy Suen CLA 2011-08-23 16:07:55 EDT
Reproduced on my Windows XP workstation.
Comment 2 Eric Moffatt CLA 2011-11-15 16:22:37 EST
I'm suspecting based on the problem being specifically regarding the Problems view (a marker view) and only occurring when it's *not* on top that this may have been introduced by the fix for bug 294959.

I'll comment on that defect to see what we can come up with...
Comment 3 Eric Moffatt CLA 2011-11-15 16:25:57 EST
Adding Dani for his take...
Comment 4 Eric Moffatt CLA 2011-11-16 09:26:58 EST
Here's the trace from when it happens...

Thread [main] (Suspended (breakpoint at line 185 in WorkbenchIntroManager))	
	WorkbenchIntroManager.setIntroStandby(IIntroPart, boolean) line: 185	
	WorkbenchPage.checkIntro() line: 1198	
	WorkbenchPage.busyShowView(IViewPart, int) line: 1168	
	WorkbenchPage.busyShowView(String, String, int) line: 1140	
	WorkbenchPage$20.run() line: 3921	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchPage.showView(String, String, int) line: 3918	
	IDEWorkbenchPlugin$2.run() line: 382	
	Display.runTimer(int) line: 4264	
	...

The timer goes off and opens the ProblemsView in 'CREATE' mode

The 'busyShowView' calls 'checkIntro' which *always* turns it into standby mode if it's not already there.

The likely fix is to change 'busyShowIntro' to check the creation mode and if it's 'create' to *not* call 'checkIntro' (since simple creation doesn't imply either activation or bring to top...
Comment 5 Dani Megert CLA 2011-11-16 09:29:04 EST
(In reply to comment #2)
> I'm suspecting based on the problem being specifically regarding the Problems
> view (a marker view) and only occurring when it's *not* on top that this may
> have been introduced by the fix for bug 294959.

It's not caused by that bug but by the fix for bug 329002.

What we do there is:

activePage.showView(viewReference.getId(), viewReference.getSecondaryId(), IWorkbenchPage.VIEW_CREATE);

It looks like for some reason the VIEW_CREATE has side effects on the Welcome page (which it shouldn't) - but that could also be caused by wrong code in the Welcome page: Only the Welcome page is affected, other views and editors that are maximized are not put aside on restart. On the other hand, the Welcome page seems to have code that puts other views aside: if one has the Welcome page in the window and some other maximized while restarting, the Welcome page shows itself, putting the maximized part aside.
Comment 6 Dani Megert CLA 2011-11-16 09:30:27 EST
> The likely fix is to change 'busyShowIntro' to check the creation mode and if
> it's 'create' to *not* call 'checkIntro' (since simple creation doesn't imply
> either activation or bring to top...

Correct. I'm already testing that fix.
Comment 7 Dani Megert CLA 2011-11-16 09:36:37 EST
Eric, I'll fix it.
Comment 8 Remy Suen CLA 2011-11-16 09:37:41 EST
Please add a test case to the test suite to prevent regressions.
Comment 9 Dani Megert CLA 2011-11-16 09:52:23 EST
Fixed in R3_development: f78f98290ccff19750795bdd3b63b5c2bb22d26b

It doesn't seen to be an issue in 4.x (and there is not Welcome yet).
Comment 10 Dani Megert CLA 2011-11-16 09:54:53 EST
(In reply to comment #8)
> Please add a test case to the test suite to prevent regressions.

Remy, do we already have tests that test Welcome page/editor state after restart? If so, can you point me to them? If there isn't already a template I'm afraid I won't have time to invest into a complicated test for this one liner 3.x fix.
Comment 11 Dani Megert CLA 2011-11-16 10:47:47 EST
> It doesn't seen to be an issue in 4.x (and there is not Welcome yet).
Filed bug 363923 to track that.
Comment 12 Eric Moffatt CLA 2011-11-16 14:55:16 EST
Dani, I'm doing the 4.x Intro work now. Let me know if the proposed fix works and I'll make the same change in the 4.x stream as part of it...
Comment 13 Dani Megert CLA 2011-11-17 02:49:46 EST
(In reply to comment #12)
> Dani, I'm doing the 4.x Intro work now. Let me know if the proposed fix works
> and I'll make the same change in the 4.x stream as part of it...

Good to hear. If you add something similar to org.eclipse.ui.intro.IIntroManager.setIntroStandby(IIntroPart, boolean).checkIntro() then just protect it the same way as we now do in 3.x. 
Also, only if you add a call to IIntroManager.setIntroStandby(anIntroPart, true) you have to worry about it.
Comment 14 Dani Megert CLA 2011-11-17 02:51:04 EST
> Remy, do we already have tests that test Welcome page/editor state after
> restart? If so, can you point me to them? If there isn't already a template I'm
> afraid I won't have time to invest into a complicated test for this one liner
> 3.x fix.

Remy, any hint? If not, I'm going to mark this FIXED and open a new bug for the test, in case someone finds time for it at later point.
Comment 15 Remy Suen CLA 2011-11-17 06:53:35 EST
(In reply to comment #14)
> Remy, any hint? If not, I'm going to mark this FIXED and open a new bug for the
> test, in case someone finds time for it at later point.

I saw an IntroTest yesterday which seems to check the standby state of the intro. I wasn't able to actually run the test though so I haven't verified whether this was true or not. If you want to mark this fixed then that's fine with me.
Comment 16 Dani Megert CLA 2011-11-17 07:02:53 EST
> I saw an IntroTest yesterday which seems to check the standby state of the
> intro. I wasn't able to actually run the test though so I haven't verified
> whether this was true or not.
Checking the state is not so the problem but rather setting up a state, restart and then check that state again.

> If you want to mark this fixed then that's fine
> with me.
OK, thx.
Comment 17 Remy Suen CLA 2011-11-17 07:09:16 EST
(In reply to comment #16)
> > I saw an IntroTest yesterday which seems to check the standby state of the
> > intro. I wasn't able to actually run the test though so I haven't verified
> > whether this was true or not.
> Checking the state is not so the problem but rather setting up a state, restart
> and then check that state again.

But couldn't you check that it is in fullscreen mode, show a view with IWorkbenchPage.VIEW_CREATE and then check that it's still in fullscreen mode? I don't think restarting is a necessity here.
Comment 18 Dani Megert CLA 2011-11-17 07:21:49 EST
(In reply to comment #17)
> (In reply to comment #16)
> > > I saw an IntroTest yesterday which seems to check the standby state of the
> > > intro. I wasn't able to actually run the test though so I haven't verified
> > > whether this was true or not.
> > Checking the state is not so the problem but rather setting up a state, restart
> > and then check that state again.
> 
> But couldn't you check that it is in fullscreen mode, show a view with
> IWorkbenchPage.VIEW_CREATE and then check that it's still in fullscreen mode? I
> don't think restarting is a necessity here.

I was hoping for a test that verified comment 0. Adding a test as you mentioned is easy. Will do that for you :-).
Comment 19 Dani Megert CLA 2011-11-17 08:05:34 EST
Added two tests: one that creates the Problems view while Welcome is in front and one that opens and activates the Problems view.

Fixed in R3_development: 502b10a501707327c51842b9ad9d87ab7d2a7c15


Eric or Remy: ui.tests is not yet split i.e. nothing to do in 'master' and the changes will be copied over to 'master' like all the other changes in non-split bundles, right?
Comment 20 Remy Suen CLA 2011-11-17 08:10:54 EST
(In reply to comment #19)
> Eric or Remy: ui.tests is not yet split i.e. nothing to do in 'master' and the
> changes will be copied over to 'master' like all the other changes in non-split
> bundles, right?

I don't believe we have this automated.
Comment 21 Markus Brakweh CLA 2011-11-17 08:18:08 EST
(In reply to comment #19)
> Added two tests: one that creates the Problems view while Welcome is in front
> and one that opens and activates the Problems view.
> 
> Fixed in R3_development: 502b10a501707327c51842b9ad9d87ab7d2a7c15
> 
> 
> Eric or Remy: ui.tests is not yet split i.e. nothing to do in 'master' and the
> changes will be copied over to 'master' like all the other changes in non-split
> bundles, right?

Daniel, thanks for the quick fix. Now, is there a way to get a patch we could use for an existing Indigo version that would just fix this behavior? Or are there too many dependencies?

Thanks
Markus
Comment 22 Dani Megert CLA 2011-11-17 08:21:13 EST
(In reply to comment #20)
> (In reply to comment #19)
> > Eric or Remy: ui.tests is not yet split i.e. nothing to do in 'master' and the
> > changes will be copied over to 'master' like all the other changes in non-split
> > bundles, right?
> 
> I don't believe we have this automated.

OK. So are you saying the non-split branches in master are basically dead wood? Because AFAIK developers did not have to cherry-pick fixes in non-shared bundles.
Comment 23 Dani Megert CLA 2011-11-17 08:22:42 EST
(In reply to comment #21)
> Daniel, thanks for the quick fix. Now, is there a way to get a patch we could
> use for an existing Indigo version that would just fix this behavior? Or are
> there too many dependencies?
> 
> Thanks
> Markus

Is this really a frequent use case? I doubt it. Paul should decide whether he wants to backport this or not.
Comment 24 Markus Brakweh CLA 2011-11-17 08:28:21 EST
(In reply to comment #23)
> (In reply to comment #21)
> > Daniel, thanks for the quick fix. Now, is there a way to get a patch we could
> > use for an existing Indigo version that would just fix this behavior? Or are
> > there too many dependencies?
> > 
> > Thanks
> > Markus
> 
> Is this really a frequent use case? I doubt it. Paul should decide whether he
> wants to backport this or not.
No, that's fine. If it would have been an easy, quick, risk-free (I know, there's no such thing;-) exchange of a class we might have considered it.
Comment 25 Dani Megert CLA 2011-11-17 10:05:29 EST
(In reply to comment #22)
> (In reply to comment #20)
> > (In reply to comment #19)
> > > Eric or Remy: ui.tests is not yet split i.e. nothing to do in 'master' and the
> > > changes will be copied over to 'master' like all the other changes in non-split
> > > bundles, right?
> > 
> > I don't believe we have this automated.
> 
> OK. So are you saying the non-split branches in master are basically dead wood?
> Because AFAIK developers did not have to cherry-pick fixes in non-shared
> bundles.
Ah, I remember now: the 'master' branch was auto-filled but fixes had to be manually cherry-picked. Did that now for the tests.

master commit: 09220d483db2705d8462ed6bc09d5761589c12f6
Comment 26 Paul Webster CLA 2012-06-15 08:16:43 EDT
*** Bug 353837 has been marked as a duplicate of this bug. ***