Bug 561027 - Weird context menu behavior when loading JavaFX within SWT
Summary: Weird context menu behavior when loading JavaFX within SWT
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-11 10:37 EDT by Sebastian Ratz CLA
Modified: 2020-03-11 10:37 EDT (History)
0 users

See Also:


Attachments
Demo Project (4.80 KB, application/x-zip-compressed)
2020-03-11 10:37 EDT, Sebastian Ratz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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?