About the SWT_AWT bridge focus bugs [message #1805855] |
Thu, 25 April 2019 14:32 |
Djak Mising name Messages: 16 Registered: November 2010 |
Junior Member |
|
|
Hi,
I'm looking for help about some SWT_AWT problems that are present in the platform for many years. There are some focus bugs that lead to various dysfunctions in SWT and RCP mechanism when embedding some AWT/Swing components in SWT composites. The behaviors are different on Linux, Windows and Mac and the dysfunctions are very hard to track.
Here is a list of related bugs: https://bugs.eclipse.org/bugs/buglist.cgi?quicksearch=AWT%20SWT%20Focus&list_id=18659835
and an issue at Oracle site: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8203855
None of workarounds created or found works for all the issues we have found in our application.
It seems the rewrite of the JRE AWT part in Java 1.7 has increased the number of dysfunctions.
Could anyone redirect me if I'm not at the right place ?
Actually I'm looking for any news and advises about this problem.
My main analysis is:
- the AWT Window activation/deactivation and focus gained/focus lost behaviors are different on Linux, Windows and OS X
- a bug in JRE seems to make difficult (impossible?) to resolve the issue in SWT
- the focus bug leads to various SWT/RCP bugs, for example: parts not activated, menu contributions not shown even if part is activated, SWT Widget never lose focus, AWT Frame never loses focus, Key event fully grabbed by AWT leading to some SWT Widget not responding
- maybe the problem is not only related to focus but also to events delegation
- the problems are still there in RCP2019-03 / SWT 3.110.0 + JRE 1.7, 1.8, or 1.10
Actually I'm looking for any information about this issue, my request for help is for example:
- do we know if the problems can be resolve outside the JRE? I meant in SWT
- is there a workaround that has been "proved" to work anywhere?
- should I continue to create issues with new discovered bugs at https://bugs.eclipse.org or is it useless (eg. the problem is in the JRE)
- do you think we need to stop to use the SWT AWT bridge?
- can we help for something?
- could the developers communicate about these problems?
Any tips will be very appreciated.
Thank you very much.
Here is, for example, a minimal sample for Linux that shows some various problems:
- once the AWT TextField has gained the focus it grabs all key events, impossible to type keys in the SWT Text widget
- the SWT Text Widget never loses the focus
- the AWT Frame never lose the focus
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.TextField;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
public class SWTAWTFocusBugsSnippet {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Composite composite = new Composite(shell, SWT.EMBEDDED);
Frame frame = SWT_AWT.new_Frame(composite);
Panel panel = new Panel(new BorderLayout());
frame.add(panel);
panel.add(new TextField());
Text text = new Text(shell, SWT.BORDER);
shell.setSize(200,70);
shell.open();
while(!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
[Updated on: Thu, 25 April 2019 14:36] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03727 seconds