Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 377981 - -perspective at product program arguments is not working in 4.2M6
Summary: -perspective at product program arguments is not working in 4.2M6
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4 M2   Edit
Assignee: Daniel Rolka CLA
QA Contact:
URL:
Whiteboard: candidate43
Keywords:
: 400443 408678 (view as bug list)
Depends on:
Blocks: 416954
  Show dependency tree
 
Reported: 2012-04-27 19:12 EDT by Cristiano Gaviao CLA
Modified: 2014-07-07 15:11 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cristiano Gaviao CLA 2012-04-27 19:12:36 EDT
Build Identifier: 4.2 M6

The program arguments of the product configuration of my project has this: -perspective myDefaultPerspective

But after start the runtime the perspective that appears is Resource.

This works properly in Eclipse Indigo.

Reproducible: Always

Steps to Reproduce:
1. create a product configuration and add -perspective <your perspective>
2. use as product: org.eclipse.platform.ide
3. use as Application: org.eclipse.ui.ide.workbench
Comment 1 Paul Webster CLA 2013-05-22 06:45:55 EDT
*** Bug 408678 has been marked as a duplicate of this bug. ***
Comment 2 Eric Moffatt CLA 2013-05-22 14:04:19 EDT
Daniel, what happens if you just uncomment the 'force' method call ? I'm more than willing to believe that it's likely too early so it fails...;-).

Also, does this end up with the Resource perspective also open ? I ask because to me APP_STARTUP_COMPLETE would indicate that it's 'ready to go' (meaning that there should already be a perspective open.

Just gathering info, I'll have to wait a bit to dig deeper...I'm about to commit a patch for a severe activation defect...
Comment 3 Daniel Rolka CLA 2013-05-23 05:29:35 EDT
(In reply to comment #2)
> Daniel, what happens if you just uncomment the 'force' method call ? I'm
> more than willing to believe that it's likely too early so it fails...;-).
> 
> Also, does this end up with the Resource perspective also open ? I ask
> because to me APP_STARTUP_COMPLETE would indicate that it's 'ready to go'
> (meaning that there should already be a perspective open.
> 
> Just gathering info, I'll have to wait a bit to dig deeper...I'm about to
> commit a patch for a severe activation defect...

I was trying just to uncomment this invocation however it didn't work - not all puzzles are in place at this stage (for instance there is not an active window yet). I was also trying to move it to the different startup place, but I've skipped it since the current fix works fine for me and it is quite simple. Unfortunately there is one little site effect, but acceptable in my opinion - since the perspective switching is done when Eclipse is displayed and ready to use (the splash screen is already hidden) it is visible to user, especially when some perspective is not present on the list and has to be created from scratch. 
Anyway if you see better place to move the Workbench.forceOpenPerspective invocation just let me know and I will refactor the fix appropriately.

With the 'resource' perspective it works fine.

thanks,
Daniel
Comment 4 Eric Moffatt CLA 2013-05-23 15:06:19 EDT
Daniel, I've amended your commit with something that appears to work without the side-effects...could you please take a look ?

Paul, this is likely the patch you want to be reviewing as well...
Comment 5 Daniel Rolka CLA 2013-05-23 15:36:54 EDT
(In reply to comment #4)
> Daniel, I've amended your commit with something that appears to work without
> the side-effects...could you please take a look ?
> 
> Paul, this is likely the patch you want to be reviewing as well...

Eric,

The code looks good to me however as far I have noticed it works slightly different than it worked in the e3.8. In 3.8 when the 'perspective' argument is present in the cli the given perspective gets activated and added to the perspective list (even when other perspective is already opened). Summarizing, in the e3.x it works very similar to the original patch. Is this change in the functionality done by purpose and I should accept this change in Gerrit?

thanks,
Daniel
Comment 6 Eric Moffatt CLA 2013-05-23 15:52:47 EDT
I checked this with McQ and we think that the 'new' behavior in 4.x is actually an improvement over the existing behavior. If we define a perspective on the command line then it should be the only perspective opened on a fresh workspace. Once the workspace has been in use we should simply honor whatever changes the user has made as far as which perspectives are open and which one is active.

I'll go over this with Paul to ensure that he agrees though...

BTW, there's a defect in 3.8 here...if you open a fresh workspace you not only get two perspectives open, the second one causes the welcome screen to go into 'stnadby' mode (i.e. it doesn't cover the whole IDE as it should). We sometimes forget that 3.x has its own wrinkles...;-).
Comment 7 Paul Webster CLA 2013-06-20 15:25:54 EDT
Just for the record, review at https://git.eclipse.org/r/#/c/13052/

PW
Comment 8 Paul Webster CLA 2013-06-21 12:44:10 EDT
As Daniel mentioned, there are 2 differences from the 3.8 behaviour:

1) it doesn't open with the default perspective the first time

2) it doesn't open with the -perspective listed the second time if the user has switched perspective

For 1, I'd like to see that fixed.  It should be similar to how we support org.eclipse.ui.IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS, although that doesn't appear fixed ATM: Bug 382625

For 2, while I understand the reason that the new behaviour makes sense to us, this is a legacy option that's probably used most by RCP apps that always want to restart on the same perspective.  That's just the way they work.  I'd argue against new behaviour unless it's conditional, since the main users of this option probably aren't users.

PW
Comment 9 Daniel Rolka CLA 2013-08-19 10:16:58 EDT
(In reply to comment #8)
> As Daniel mentioned, there are 2 differences from the 3.8 behaviour:
> 
> 1) it doesn't open with the default perspective the first time
> 
> 2) it doesn't open with the -perspective listed the second time if the user
> has switched perspective
> 

Let me take a look at it,
Daniel
Comment 10 Daniel Rolka CLA 2013-08-19 10:38:39 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > As Daniel mentioned, there are 2 differences from the 3.8 behaviour:
> > 
> > 1) it doesn't open with the default perspective the first time
> > 
> > 2) it doesn't open with the -perspective listed the second time if the user
> > has switched perspective
> > 
> 
> Let me take a look at it,
> Daniel

The altered patch has been sent to Gerrit - http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=42ce0ebd334dceb0bf188db62251c38c092256f1

Daniel
Comment 11 Lars Vogel CLA 2013-08-19 14:34:15 EDT
Gerrit review: https://git.eclipse.org/r/#/c/13052/
Comment 12 Paul Webster CLA 2013-08-23 16:45:43 EDT
Eric, I think it's ready for another review.

PW
Comment 14 Daniel Rolka CLA 2013-09-17 04:10:25 EDT
Verified in the build: I20130916-2330
Comment 15 Paul Webster CLA 2014-07-07 15:11:34 EDT
*** Bug 400443 has been marked as a duplicate of this bug. ***