| Summary: | On GTK PopupList throws an exception while open if the parent window closes. PopupList also fails to gain focus on open. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jason Safavi <jason.safavi> | ||||
| Component: | SWT | Assignee: | Xi Yan <xixiyan> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | carolynmacleod4, dave.smith, ericwill, gheorghe, peter, pinnamur, Silenio_Quarti, xixiyan | ||||
| Version: | 3.4 | Keywords: | triaged | ||||
| Target Milestone: | 4.9 M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| See Also: |
https://git.eclipse.org/r/124491 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3a449ba573dc88c6875f0f7ccd6b3a19476b0468 |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 155329 [details]
Patch v01
I couldn't reproduce the scenario where opening the popupList throws an exception when it's parent closes. However, I've noticed that the popupList doesn't not take focus when it is opened in the FocusListener of a different widget. Since there is an inconsistency in popupList taking focus, I had added code changes that might set the focus to popupList in required scenarios.
Bogdan, Please review the patch. Thanks.
Bog/Silenio, Would it be possible to review this simple patch ? Still reproducible on 4.8 M7, GTK3.22, and Fedora 28. New Gerrit change created: https://git.eclipse.org/r/124491 Gerrit change https://git.eclipse.org/r/124491 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3a449ba573dc88c6875f0f7ccd6b3a19476b0468 (In reply to Eclipse Genie from comment #5) > Gerrit change https://git.eclipse.org/r/124491 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=3a449ba573dc88c6875f0f7ccd6b3a19476b0468 In master now, thanks Xi. |
Build ID: 3.3 Steps To Reproduce: See attached code snippet: import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.custom.PopupList; import org.eclipse.swt.graphics.Rectangle; public class List { public List() { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Test"); GridLayout layout = new GridLayout(4, false); shell.setLayout(layout); field1 = new Text(shell, SWT.SINGLE); field2 = new Text(shell, SWT.SINGLE); field1.addFocusListener(focus); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } private FocusAdapter focus = new FocusAdapter() { public void focusGained(FocusEvent e) { } public void focusLost(FocusEvent e) { list = new PopupList(field1.getShell()); String[] items = {"item 1", "item 2", "item 3"}; list.setItems(items); Rectangle rect = new Rectangle(0, 0, 100, 100); list.open(rect); } }; public static void main(String args[]) { new List(); } private Text field1; private Text field2; private PopupList list; } More information: The PopupList fails to gain focus when it opens.