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

Bug 120656

Summary: [Dialogs] SWTExeption: Widget is disposed when resizing quick outline
Product: [Eclipse Project] Platform Reporter: Benno Baumgartner <benno.baumgartner>
Component: UIAssignee: Susan McCourt <susan>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse, markus.kell.r, martinae, michaelvanmeekeren, susan
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
PopupDialog patch none

Description Benno Baumgartner CLA 2005-12-13 13:22:28 EST
Version: 3.2.0
Build id: I20051213-0010

Open quick outline (Ctrl-O), in the context menu select resize, after resizing the following exception is thrown:

org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3283)
	at org.eclipse.swt.SWT.error(SWT.java:3206)
	at org.eclipse.swt.SWT.error(SWT.java:3177)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:421)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:316)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:2158)
	at org.eclipse.jface.dialogs.PopupDialog.performTrackerAction(PopupDialog.java:752)
	at org.eclipse.jface.dialogs.PopupDialog.access$0(PopupDialog.java:741)
	at org.eclipse.jface.dialogs.PopupDialog$ResizeAction.run(PopupDialog.java:137)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:492)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:480)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:392)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3241)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2861)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1762)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1726)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:397)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Comment 1 Susan McCourt CLA 2005-12-13 14:57:57 EST
This is a regression from the standpoint of the quick outliner, caused by the adoption of PopupDialog.  This should be fixed for M4.
Comment 2 Susan McCourt CLA 2005-12-13 18:36:40 EST
This regression can be "fixed" by backing out the change to bug #115785.  What's puzzling is that I checked the move/resize scenarios on all platforms as part of verifying that bug when I fixed it.  So either something underneath in SWT-land changed (unlikely on windows?) or as part of trying various fixes on various platforms, this regression was inadvertently introduced (by not rechecking on a particular platform).

Regardless, this scenario and the scenario in bug #115785 need to be verified on all platforms.  Investigating....
Comment 3 Susan McCourt CLA 2005-12-13 19:54:30 EST
Created attachment 31698 [details]
PopupDialog patch

works on windows, to be tested on other platforms
Comment 4 Susan McCourt CLA 2005-12-13 20:14:49 EST
verified that the M4 code, as well as the proposed patch, works fine on the Mac.
Comment 5 Susan McCourt CLA 2005-12-13 20:39:32 EST
Fixed >20051213.
Verified on windows and Mac.
Since move/resize was completely broken on windows, I've taken the liberty of releasing this fix.  

I don't know if the problem appeared in I20051213-0010 on Linux or not (it did not appear on the Mac, as it's specific to shell/tracker deactivate events.)

Marking bug as fixed, but this still must be verified on Linux.
Doug, can you verify with latest from HEAD (or any build that includes this fix?)

If anyone from Zurich can check this on Linux (while we sleep), that would be helpful, too.  Here are three related scenarios that must be checked:

SCENARIO 1
- open quick outline (ctrl-o)
- open the context (upper right) menu by clicking on the arrow
- choose resize
- track the resize with the mouse, then release the mouse
- popup should resize
- click in the editor (outside of the popup)
- the popup should now disappear
- invoking ctrl-o again should open the popup

SCENARIO 2 (from 115785)
- open quick outline (ctrl-o)
- open the context (upper right) menu by clicking on the arrow
- click in the editor (outside of the popup)
- either the entire popup will close, or just the menu (this is platform dependent and either is okay).  If only the menu closed, click again in the editor to close the popup
- now use ctrl-o again to open the popup
- observe that the popup opens again

SCENARIO 3
- open quick outline (ctrl-o)
- open the context (upper right) menu by clicking on the arrow
- choose move
- track the move with the mouse
- escape from the move before releasing the mouse
- either the entire popup will close on Esc, or just the tracker (this is platform dependent and either is okay).  If only the tracker closed, click again in the editor to close the popup
- now use ctrl-o again to open the popup
- observe that the popup opens again
Comment 6 Dani Megert CLA 2005-12-14 03:30:51 EST
Verified all scenrios including leak checking on WinXP using I20051214-0010.

Tom, please check Linux-GTK.
Comment 7 Tom Hofmann CLA 2005-12-14 12:00:01 EST
I checked that all scenarios work without throwing an exception.

However, with scenario 1 and 3, Ctrl+O will not open the outline any longer after closing it the first time, because the keybinding is not bound any longer. Choosing "Navigate > Quick Outline" works and restores the old behavior.

Will file a bug.
Comment 8 Susan McCourt CLA 2005-12-14 12:10:09 EST
yes, please file a new bug.
That sounds very similar to bug #115785, although in the original bug it was Win XP and I don't recall if it was only the key binding that broke, or if the dialog would never reopen.
Comment 9 Susan McCourt CLA 2005-12-14 12:12:47 EST
I'll mark this bug as verified and we can discuss severity of the outstanding Linux issue in that bug.
Comment 10 Susan McCourt CLA 2005-12-14 13:09:20 EST
Tom - is there a bug # yet for the new problem on Linux?  I haven't seen one come in yet.