This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 394395 - Editor area diappears on Maximize, Minimize
Summary: Editor area diappears on Maximize, Minimize
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M1   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: candidate43
Keywords:
: 406926 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-15 10:27 EST by Markus Keller CLA
Modified: 2013-08-26 12:21 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2012-11-15 10:27:43 EST
I20121113-0800

- new workspace
- close Welcome
- click into Package Explorer (bug 394394)
- paste this:

package p;
public class C {
	public static void main(String[] args) {
		int i= 2;
		System.out.println(i);
	}
}

- click Maximize button of editor
- click Minimize button of editor

=> editor area is gone

- clicking Maximize, Restore in the Outline brings the editor back

- when I click Maximize, Minimize in the Package Explorer while the editor area is gone, I sometimes get this NPE:

!ENTRY org.eclipse.equinox.event 4 0 2012-11-15 16:25:48.542
!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/application/ApplicationElement/tags/REMOVE] to
handler org.eclipse.e4.ui.services.internal.events.UIEventHandler@ca1b35
!STACK 0
java.lang.NullPointerException
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.restore(MinMaxAddon.java:578)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$8.handleEvent(MinMaxAddon.java:395)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
        at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:725)
        at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:460)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.unzoom(MinMaxAddon.java:742)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$8.handleEvent(MinMaxAddon.java:397)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
        at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
        at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
        at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
        at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
        at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
        at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
        at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
        at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
        at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
        at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
        at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
        at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:725)
        at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:460)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.setState(MinMaxAddon.java:280)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon.access$2(MinMaxAddon.java:270)
        at org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddon$3.restore(MinMaxAddon.java:177)
        at org.eclipse.swt.custom.CTabFolder.onSelection(CTabFolder.java:2024)
        at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:285)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1026)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:915)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:79)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:587)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:542)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Comment 1 Eric Moffatt CLA 2012-11-15 14:34:20 EST
I can repro this except for the exception you're seeing...can you provide any more details ?
Comment 2 Markus Keller CLA 2012-11-16 09:33:26 EST
Sorry, the right steps for the NPE are:

- follow comment 0 until "=> editor area is gone"
- click Maximize, Restore (not Minimize) in the Package Explorer

Note that there are a few other bugs about an NPE in MinMaxAddon.restore, but I wasn't sure if that part is a dup or if it can only happens after the editor area disappeared.
Comment 3 Joseph Carroll CLA 2013-03-06 11:09:07 EST
I wasn't able to reproduce the NPE, but I can reproduce everything else.

In addition, if you open a new file, the editor area still thinks it is maximized (minimized?) and only provides a restore option.  When you click restore nothing happens.
Comment 4 Paul Webster CLA 2013-05-21 08:20:44 EDT
Using the steps in bug 400048 the editor area disappears and I get a grey square on top of my eclipse.

PW
Comment 5 Paul Webster CLA 2013-05-21 11:17:10 EDT
(In reply to comment #4)
> Using the steps in bug 400048 the editor area disappears and I get a grey
> square on top of my eclipse.

On further inspection bug 400048 is not the same bug.

Launch Eclipse with a new workspace (as it will become unusable in a few minutes)
In the Resource perspective, create a new Project
Create a new File (test1.txt) 
Create a new File (test2.txt) 
Double click on the editor tab for test1.txt to maximize it
Click the minimize icon on the editor toolbar
> Now you have a problem, because the editors did not go back to their correct location 
-- using the Restore button in the editor toolbar has no affect
-- closing the editors leaves an unusable area on the screen that cannot be recovered (see screen capture)
-- Reset Perspective has no affect
-- sometimes restarting the workspace seems to get things working again (though not always)
-- sometimes the NPE below can be found in the Error Log (though not always)
Comment 6 Eric Moffatt CLA 2013-05-21 11:29:07 EDT
I've pushed the fix for this to Gerrit:

https://git.eclipse.org/r/13029

What happens is (starting with the maximized EA):

1) Hit Minimize: This automatically causes an unzoom, meaning that all the elements in the trim restore to the main presentation.

* The side effect of this is that the trim has no more visible children causing the CleanupAddon to asynch some code to set the TBR of the trim to false.

2) The EA goes minimized, causing it to add the EA's TrimStack to the trim.

Now, the asynch fires and sets the TBR on the *trim* to false...boom, no minimized EA.

Fix if very simple...recheck in the asynch to ensure that there are *still* no visible children.
Comment 7 Paul Webster CLA 2013-05-21 14:02:20 EDT
I got into one state with https://git.eclipse.org/r/13029 where the editor area was both in the trim and displayed in its regular location on startup.  The first click into an editor would 1) move it and expand it as if it was minimized and 2) leave a grey blank area where the editor area used to be (so the space was not reclaimed).

I haven't been able to create a reproducible test case though.

PW
Comment 8 Eric Moffatt CLA 2013-05-21 14:21:28 EDT
I don't see how this could possibly have been introduced by changing the CleanupAddon to recheck before doing something obviously wrong.

I'm guessing that there are other fixes in the MinMaxAddon that haven't been back-ported to 4.2.2. As a first pass we could try to see what we get using the *current* MinMaxAddon code + the patch. If this works then we can either go with it or use the history to cherry-pick the other needed fixes...
Comment 9 Curtis Windatt CLA 2013-05-21 16:04:20 EDT
Tried out Eric's fix and had no issues.
Comment 10 Eric Moffatt CLA 2013-05-23 15:11:13 EDT
Paul, ant status here ? Unless we can get a handle on what happened on your box I can't see this as being a bad fix...
Comment 11 Paul Webster CLA 2013-05-30 08:14:37 EDT
(In reply to comment #7)
> I got into one state with https://git.eclipse.org/r/13029 

I have not run into the problem again, and this fixes the issue.

The Gerrit patch is targetted at master, so it'll need to be cherry-picked for R4_2_maintenance

PW
Comment 12 Eric Moffatt CLA 2013-07-31 11:00:03 EDT
Paul, what's the status of this. It's not marked fixed but the code seems to be in both R4_3_maintenance and master...

Not really sure if it's in 4.2.2 (or even if it needs to be).
Comment 13 Paul Webster CLA 2013-08-01 10:12:54 EDT
Fixed by Bug 410828

PW
Comment 14 Daniel Rolka CLA 2013-08-07 08:10:19 EDT
Verified in the build: I20130805-2000
Comment 15 Curtis Windatt CLA 2013-08-19 11:04:57 EDT
*** Bug 403760 has been marked as a duplicate of this bug. ***
Comment 16 Curtis Windatt CLA 2013-08-26 12:21:59 EDT
*** Bug 406926 has been marked as a duplicate of this bug. ***