Bug 561027

Summary: Weird context menu behavior when loading JavaFX within SWT
Product: [Eclipse Project] Platform Reporter: Sebastian Ratz <sebastian.ratz>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Demo Project none

Description Sebastian Ratz CLA 2020-03-11 10:37:12 EDT
Created attachment 282088 [details]
Demo Project

After loading JavaFX inside SWT's main thread the context menu starts to behave differently:

1. Run SWT event loop
2. Try context menu: On short right click the popup menu opens and stays open.
3. Load JavaFX with shared event thread
   3.1 System.setProperty("javafx.embed.isEventThread", "true")
   3.2 Instantiate any JavaFX object (e.g. javafx.embed.swing.JFXPanel)
4. Try context menu: On short right click the popup menu opens but closes
   again instantly. Press-and-hold is necessary to work with the menu.

I have attached a test project to reproduce the behavior.

This happens on Ubuntu 18.04 using OpenJDK 11 / 13 with JavaFX 11 / 13.

I am not sure that this is actually a problem in SWT or rather in JavaFX / GTK.

But maybe there is a way to work around this in SWT?