Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 189213 Details for
Bug 337475
[Shell] Widget is disposed exception is thrown in a somewhat peculiar configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch to reproduce the problem
337475_Shell_widget_disposed.patch (text/plain), 5.76 KB, created by
Istvan Ballok
on 2011-02-17 13:42:48 EST
(
hide
)
Description:
patch to reproduce the problem
Filename:
MIME Type:
Creator:
Istvan Ballok
Created:
2011-02-17 13:42:48 EST
Size:
5.76 KB
patch
obsolete
>commit ae12491e223367b5ea5c25ed9e0b5d8edbbdc9c1 >tree 5131218a19a9bddf2673792bcaf651df0300c8ec >parent 2ba2058a8c2218978047317bd0912cce681a8ae7 >author Istvan Ballok <Istvan.Ballok@cas.de> 1297968005 +0100 >committer Istvan Ballok <Istvan.Ballok@cas.de> 1297968005 +0100 > > 337475 [Shell] Widget is disposed exception is thrown in a somewhat peculiar configuration > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=337475 > > To reproduce > ============ > Apply the attached patch (note: it is based on the current git master). > This slightly modifies the ShellTab example of the controls demo. > > Select the "Shell" tab, and perform a double click on the "Open Shell" > button. A Widget is disposed exception is thrown. > > The peculiar configuration > ========================== > - the button opens a new shell > - the shell is accessed when it is activated > - the shell is closed when it is deactivated > - the button is clicked with a double click* > > This is the essence of the problem I observed in our application. > > (*: double click: e.g. instead of a single click, > the user performs a double click by mistake) > > My investigation > ================ > - the SWT (and qooxdoo) buttons does not support a double click > - a double click is conveyed as too seperate click events, > one after the other > - the second event is queued in the client, and hence it is > not the same as 2 slow clicks. (see focus handling) > > # the first click opens a shell, it is focused. > # the second click event arrives > # (the focus is not changed, because it is the old, queued event from the client) > # the second shell is opened: during open, > # first, the other shells are deactivated > -> the first shell loses focus / is deactivated > -> the first shell is closed > -> during its disposition, an (!)ancestor of the first shell receives the focus > -> (!)the second shell is deactivated, as a consequence > -> the second shell is disposed > # second, the new shell is activated > -> the second shell is activated - but it is already disposed > > Is it a bug in RWT? > =================== > I am not sure, I have not yet tested this snippet with SWT. > But even if it is not considered a bug, > it is certainly an unexpected behaviour > that is worth sharing/discussing in a bugzilla issue. > >diff --git a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ControlsDemo.java b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ControlsDemo.java >index f036a9f..fe82851 100644 >--- a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ControlsDemo.java >+++ b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ControlsDemo.java >@@ -56,6 +56,7 @@ public class ControlsDemo implements IEntryPoint { > topFolder.marginHeight = 5; > > final ExampleTab[] tabs = new ExampleTab[] { >+ new ShellTab( topFolder ), > new ButtonTab( topFolder ), > // new RequestTab( topFolder ), > new CBannerTab( topFolder ), >@@ -73,7 +74,6 @@ public class ControlsDemo implements IEntryPoint { > new LinkTab( topFolder ), > new SashTab( topFolder ), > new SashFormTab( topFolder ), >- new ShellTab( topFolder ), > new TabFolderTab( topFolder ), > new CTabFolderTab( topFolder ), > new TableTab( topFolder ), >diff --git a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ShellTab.java b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ShellTab.java >index 2e63c0d..0121290 100644 >--- a/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ShellTab.java >+++ b/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/ShellTab.java >@@ -31,6 +31,8 @@ public class ShellTab extends ExampleTab { > private final java.util.List shells; > private int shellCounter; > private final ShellAdapter confirmCloseListener; >+ private final ShellAdapter shellActivatedListener; >+ private final ShellAdapter shellDeactivatedListener; > private Image shellImage; > private Button createInvisibleButton; > private Button createAsDialogButton; >@@ -52,6 +54,16 @@ public class ShellTab extends ExampleTab { > event.doit = canClose; > } > }; >+ shellActivatedListener = new ShellAdapter() { >+ public void shellActivated( ShellEvent e ) { >+ ((Shell)e.getSource()).getData(); >+ } >+ }; >+ shellDeactivatedListener = new ShellAdapter() { >+ public void shellDeactivated( ShellEvent e ) { >+ ((Shell)e.getSource()).close(); >+ } >+ }; > setDefaultStyle( SWT.SHELL_TRIM ); > } > >@@ -188,11 +200,7 @@ public class ShellTab extends ExampleTab { > > private void createShell() { > Shell shell; >- if( createAsDialogButton.getSelection() ) { >- shell = new Shell( getShell(), getStyle() ); >- } else { >- shell = new Shell( getShell().getDisplay(), getStyle() ); >- } >+ shell = new Shell( getShell(), getStyle() ); > // if( customBgColorButton.getSelection() ) { > // shell.setBackground( BG_COLOR_BROWN ); > // } >@@ -206,6 +214,8 @@ public class ShellTab extends ExampleTab { > shell.setText( "Test Shell " + shellCounter ); > shell.setAlpha( alpha ); > shell.setImage( shellImage ); >+ shell.addShellListener( shellActivatedListener ); >+ shell.addShellListener( shellDeactivatedListener ); > if( confirmCloseButton.getSelection() ) { > shell.addShellListener( confirmCloseListener ); > } >@@ -348,7 +358,7 @@ public class ShellTab extends ExampleTab { > private Point getNextShellLocation() { > Point result = getShell().getLocation(); > int count = getShells().length % 12; >- result.x += 50 + count * 10; >+ result.x += 200 + count * 10; > result.y += 50 + count * 10; > return result ; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 337475
: 189213 |
191690
|
191752