2121import org .eclipse .core .runtime .dynamichelpers .IExtensionChangeHandler ;
2222import org .eclipse .core .runtime .dynamichelpers .IExtensionTracker ;
2323import org .eclipse .e4 .ui .model .application .ui .MUIElement ;
24+ import org .eclipse .e4 .ui .model .application .ui .advanced .MArea ;
2425import org .eclipse .e4 .ui .model .application .ui .advanced .MPlaceholder ;
2526import org .eclipse .e4 .ui .model .application .ui .basic .MPart ;
2627import org .eclipse .e4 .ui .model .application .ui .basic .MPartStack ;
2728import org .eclipse .e4 .ui .workbench .IPresentationEngine ;
29+ import org .eclipse .e4 .ui .workbench .addons .minmax .MinMaxAddonUtil ;
30+ import org .eclipse .swt .custom .CTabFolder ;
2831import org .eclipse .ui .IViewPart ;
2932import org .eclipse .ui .IViewReference ;
3033import org .eclipse .ui .IWorkbenchPage ;
@@ -191,7 +194,7 @@ public void setIntroStandby(IIntroPart part, boolean standby) {
191194 return ;
192195 }
193196
194- MPartStack introStack = getIntroStack (viewIntroAdapterPart );
197+ MUIElement introStack = getIntroStack (viewIntroAdapterPart );
195198 if (introStack == null ) {
196199 return ;
197200 }
@@ -204,22 +207,26 @@ public void setIntroStandby(IIntroPart part, boolean standby) {
204207 }
205208 }
206209
207- private MPartStack getIntroStack (ViewIntroAdapterPart introAdapter ) {
210+ private MUIElement getIntroStack (ViewIntroAdapterPart introAdapter ) {
208211 ViewSite site = (ViewSite ) introAdapter .getViewSite ();
209212
210213 MPart introModelPart = site .getModel ();
211214 if (introModelPart .getCurSharedRef () != null ) {
212215 MUIElement introPartParent = introModelPart .getCurSharedRef ().getParent ();
213- if (introPartParent instanceof MPartStack ) {
214- return (MPartStack ) introPartParent ;
216+ if (introPartParent instanceof MPartStack parentStack ) {
217+ MArea parentArea = MinMaxAddonUtil .getAreaFor (parentStack );
218+ if (parentArea != null && !(parentArea .getWidget () instanceof CTabFolder )) {
219+ return parentArea .getCurSharedRef ();
220+ }
221+ return introPartParent ;
215222 }
216223 }
217224
218225 return null ;
219226 }
220227
221228 private boolean isIntroMaximized (ViewIntroAdapterPart introAdapter ) {
222- MPartStack introStack = getIntroStack (introAdapter );
229+ MUIElement introStack = getIntroStack (introAdapter );
223230 if (introStack == null ) {
224231 return false ;
225232 }
0 commit comments