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 264574 Details for
Bug 245593
Disposing a widgets parent during event processing like focusLost is causing a gpf
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.
Snippet reproducing the focus issue
Bug245593_DisposeWidgetParent.java (text/x-java), 2.16 KB, created by
Eric Williams
on 2016-10-04 11:01:31 EDT
(
hide
)
Description:
Snippet reproducing the focus issue
Filename:
MIME Type:
Creator:
Eric Williams
Created:
2016-10-04 11:01:31 EDT
Size:
2.16 KB
patch
obsolete
>package z_unsorted; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.FocusAdapter; >import org.eclipse.swt.events.FocusEvent; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.Text; > >/** > * This Snippet is supposed to demonstrate a probable Bug in SWT for gtk. It causes a general protection fault when you do the following: > * - launch as swt app > * - focus the first textfield > * - click into the second textfield > * - click back into the first one --> should crash with a GPF with: Symbol=IA__gtk_container_set_focus_child . The symbol changes from time to time to g_object_lib but is the focus_child one most of the time > * - it usually happens the first time this is done but you sometimes might have to do it 2-3 times > * > * The Problem seems to arise because the widget that looses focus is disposed during its own focus event processing. Though this works without problems on windows plattforms. > * @author psimon > * > */ >public class Bug245593_DisposeWidgetParent { > Shell shell; > > public Bug245593_DisposeWidgetParent() { > final Display display = new Display(); > shell = new Shell(display); > shell.setLayout(new FillLayout()); > shell.setSize(200,200); > createWidgets(); > shell.open (); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep(); > } > display.dispose(); > } > public static void main(String [] args) { > new Bug245593_DisposeWidgetParent(); > } > > public void disposeWidgets(){ > parent.dispose(); > } > > private Composite parent; > > public void createWidgets(){ > parent = new Composite(shell,SWT.NONE); > parent.setLayout(new GridLayout(2,true)); > Text triggerText = new Text(parent,SWT.BORDER); > triggerText.setText("text 1"); > Text looseFocus = new Text(parent,SWT.BORDER); > looseFocus.setText("text 2"); > triggerText.addFocusListener(new FocusAdapter(){ > > public void focusLost(FocusEvent e) { > triggerRefresh(); > } > > }); > > shell.layout(); > } > > public void triggerRefresh(){ > disposeWidgets(); > createWidgets(); > shell.layout(); > } > > }
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 Raw
Actions:
View
Attachments on
bug 245593
:
111253
| 264574