Bug 509374 - Intro/Welcome not shown when opening a new workspace when more than one perspective is open by default
Summary: Intro/Welcome not shown when opening a new workspace when more than one persp...
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on: 322439
Blocks:
  Show dependency tree
 
Reported: 2016-12-16 20:41 EST by Joseph Benken CLA
Modified: 2021-02-06 01:39 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Benken CLA 2016-12-16 20:41:59 EST
The intro/welcome is not shown when opening a new workspace if there is more than open perspective open.  In my case, the plugin_customization.ini for my product sets org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS to open a couple extra perspectives by default.

This problem appears to have been introduced by the commit mentioned in PR 322439 comment 8.  This commit added the the following to org.eclipse.ui.internal.WorkbenchWindow.setup():

// Hack!! don't show the intro if there's more than one open perspective
List<MPerspective> persps = modelService.findElements(model, null, MPerspective.class, null);
if (persps.size() > 1) {
	PrefUtil.getAPIPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_INTRO, false);
	PrefUtil.saveAPIPrefs();
}

Perhaps this "hack" isn't really needed anymore?  Regardless of how many perspectives are open, I notice that the welcome screen will still show if new content is available (see org.eclipse.ui.internal.intro.universal.contentdetect.ContentDetector.isNewContentAvailable()).

This is a blocking problem for me because I need to show the welcome screen whenever a new workspace is opened in addition to my product opening multiple perspectives by default.
Comment 1 Patrik Suzzi CLA 2016-12-19 20:03:57 EST
Joseph,

I do not understand fully the bug description. 
- Would you mind adding a sequence of steps to reproduce the issue or a zipped workspace we can use to test the error?
- Which version of Eclipse are you using ? (Ctrl+3,>Copy Build Id..)

Thanks for reporting!
Comment 2 Joseph Benken CLA 2016-12-19 20:40:32 EST
(In reply to Patrik Suzzi from comment #1)
> - Would you mind adding a sequence of steps to reproduce the issue

I am very happy to do that and apologize if my explanation is not clear.

I am an Eclipse plugin developer.  I have an Eclipse plugin that is defining an Eclipse product as-in the "org.eclipse.core.runtime.products" extension point.  I start Eclipse with -product <my_product_id> argument.  Does this make sense?  If I'm still not being clear, what I'm doing is described in the Eclipse Help under "Platform Plug-in Developer Guide > Programmer's Guide > Packaging and delivering Eclipse based products > Defining a Product".

In particular, the heading "Preferences defaults" describes how you can define a "plugin_customization.ini" with default preference values.  In my case, the plugin_customization.ini for my product includes a property for "org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS" so that my product can open multiple perspectives by, like what happens when when opening a new workspace.  You can read the javadocs for org.eclipse.ui.IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_EXTRAS for more detail about this preference option.


(In reply to Patrik Suzzi from comment #1)
> or a zipped workspace we can use to test the error?

I am referring to the behavior when a new workspace is opened for the first time (an empty or non-existent directory).  So, there is no workspace to attach here.  :)

There are at least two cases where the Eclipse intro/welcome screen is shown.  The behavior I'm about to summarize is happening in org.eclipse.ui.application.WorkbenchWindowAdvisor.openIntro().  I think the method speaks for itself if you view the source but here is my high level summary which is required to understand the issue:

1.) The welcome screen is shown when opening a workspace for the very first time.  This has to do with the IWorkbenchPreferenceConstants.SHOW_INTRO preference value defaulting to true.  In other words, when Eclipse opens a new workspace all preferences are at defaults and this preference option will be set to true.  Eclipse will test this preference value, show the welcome screen if SHOW_INTRO is true, and then immediately set SHOW_INTRO to false so the welcome screen does not automatically open again.

This would be fine except for the "hack" I mentioned in comment 0 broke this behavior for Eclipse products that open multiple perspectives by default.  The code change I referenced forces IWorkbenchPreferenceConstants.SHOW_INTRO preference value to false.

2.) The other case is when new content is available, like if a feature was installed that contributed new content to the welcome screen.  From what I can tell, this functionality appears to be dependent on the org.eclipse.ui.intro.universal/*.xml files the osgi instance area.  This works fine in my case as this isn't broken by the "hack" which only affects the IWorkbenchPreferenceConstants.SHOW_INTRO preference value.


> - Which version of Eclipse are you using ? (Ctrl+3,>Copy Build Id..)

I'm using Neon.1 release.  Although, it looks like the problem has been broken for a long time based on when the breaking change was made.


> Thanks for reporting!

I am really happy to help and provide more detail if needed.
Comment 3 Joseph Benken CLA 2016-12-19 21:01:21 EST
EXPECTED BEHAVIOR:
The Into/Welcome screen is always shown when opening a new workplace.

ACTUAL BEHAVIOR:
The Into/Welcome screen is shown when opening a new workplace as the product being started only opens a single perspective by default.  The Into/Welcome screen is not shown if the Eclipse product opens multiple perspectives by default by way of its plugin_customization.ini listing one or more perspective IDs for the org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS property.
Comment 4 Andreas K CLA 2017-01-19 09:00:08 EST
I have the same issue in a RCP application based on Neon.1

Steps to reproduce (Tested with build I20170117-2000):
1. Download the build
2. Extract and modify the file "\eclipse\plugins\org.eclipse.sdk_4.7.0.v20170117-2000\plugin_customization.ini" by adding the entry "org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=org.eclipse.ui.resourcePerspective"
3. Start Eclipse and you'll not see the intro anymore but you'll have two perspectives instead of only one.

This is a regression.
Comment 5 Eclipse Genie CLA 2019-10-11 01:51:53 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Lakshminarayana CLA 2021-02-06 01:39:26 EST
I can reproduce it with 2020-06 also.

This was the commit that causes the problem.

https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=ae6a1ca03cd12e1b18924c02836c25fecc81eb0f

Either we can remove the hack or limit the fix for E4 applications.

Someone who has a good idea of this area can review it.