|
|
|
|
|
|
Re: JavaFx event locking problems with JRE 7u40 [message #1121617 is a reply to message #1116706] |
Mon, 30 September 2013 16:23  |
Eclipse User |
|
|
|
Hi,
So the bug is accepted by Steve ;-)
https://javafx-jira.kenai.com/browse/RT-33258
Tom
On 25.09.13 21:09, Tom Schindl wrote:
> FXCanvas is the problem and this is part of JavaFX. So yes I'm sure this
> is a problem of FXs FXCanvas implementation.
>
> I'll try to come up with a standalone SWT-App and file a JIRA.
>
> Tom
>
> On 25.09.13 20:38, Timm Baumeister wrote:
>> Thomas Schindl wrote on Wed, 25 September 2013 03:08
>>> Can you please file a JIRA against FX? Please cc me on the ticket, I
>>> hope Steve can find out what happens. So the workaround would be to open
>>> only JavaFX-Dialogs from within JavaFX :)
>>>
>>> If you have a snippet to reproduce this in plain SWT I could give it a
>>> spin in OS-X or don't want to create the account i could file a the JIRA
>>> on behalf of you
>>
>>
>> Are you sure that this is an issue which belongs into the fx jira? To me
>> it looks so far as if it is related to how fx is bound into eclipse (as
>> it is not happening when using plain swt). I can't give you a plain SWT
>> test case, but I can provide a simple eclipse plugin test case. If you
>> tell me that this should be considered as an fx issue I will file it in
>> their jira.
>>
>> I have a much simpler test case now without the jface dialog. What
>> happens is that an swt event loop doesn't process fx events if created
>> from within fx. Here the test case:
>>
>>
>> import javafx.embed.swt.FXCanvas;
>> import javafx.event.ActionEvent;
>> import javafx.event.EventHandler;
>> import javafx.geometry.Insets;
>> import javafx.scene.Scene;
>> import javafx.scene.control.Button;
>> import javafx.scene.layout.StackPane;
>>
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.events.MouseAdapter;
>> import org.eclipse.swt.events.MouseEvent;
>> import org.eclipse.swt.layout.FillLayout;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Shell;
>>
>> public class TestFx {
>> static public void test() {
>> Display display = Display.getDefault();
>>
>> Shell shell = new Shell(display.getActiveShell(),SWT.MODELESS |
>> SWT.BORDER | SWT.CLOSE);
>> shell.setLayout(new FillLayout());
>>
>> // fx open shell button
>> FXCanvas fxCanvas = new FXCanvas(shell, SWT.NONE);
>> StackPane pane = new StackPane();
>> pane.setPadding(new Insets(10));
>> Button button = new Button("FX Open Shell");
>> button.setOnAction(new EventHandler<ActionEvent>() {
>> @Override public void handle(ActionEvent e) {
>> test();
>> }
>> });
>> pane.getChildren().add(button);
>> Scene scene = new Scene(pane);
>> fxCanvas.setScene(scene);
>> // swt open shell button
>> org.eclipse.swt.widgets.Button b = new
>> org.eclipse.swt.widgets.Button(shell, SWT.NONE);
>> b.setText("SWT Open Shell");
>> b.addMouseListener(new MouseAdapter() {
>> @Override
>> public void mouseDown(MouseEvent e) {
>> test();
>> }
>> });
>> shell.pack();
>> shell.open ();
>> /* event loop - processes swt/fx events if test()
>> was called from swt
>> - processes only swt but no fx events if test() was called
>> from fx
>> all fx events during this time will be processed only
>> after the event loop terminates */
>> while (!shell.isDisposed()) {
>> try {
>> if (!display.readAndDispatch()) {
>> display.sleep();
>> }
>> } catch (Throwable e) {
>> e.printStackTrace();
>> }
>> }
>> }
>> // lockup does not occur if this is run as a standalone swt app
>> public static void main(String[] args) {
>> test();
>> }
>> }
>>
>>
>>
>> I looked at the the call stacks when calling this in plain swt and in
>> eclipse, which are identical except for:
>>
>> Plain SWT
>>
>> ..
>> PlatformImpl$4.run() line: 176
>> OS.DispatchMessageW(MSG) line: not available [native method]
>> OS.DispatchMessage(MSG) line: 2546
>> Display.readAndDispatch() line: 3756
>> ..
>>
>>
>> Eclipse
>>
>> ..
>> PlatformImpl$4.run() line: 176
>> InvokeLaterDispatcher$Future.run() line: 76
>> OS.DispatchMessageW(MSG) line: not available [native method]
>> OS.DispatchMessage(MSG) line: 2546
>> Display.readAndDispatch() line: 3756
>> ..
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03860 seconds