Bug 581821 - [wayland] No drawing on AWT canvas using SWT_AWT bridge
Summary: [wayland] No drawing on AWT canvas using SWT_AWT bridge
Status: NEW
Alias: None
Product: Incubator
Classification: Eclipse Project
Component: e4 (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: E4 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-17 10:00 EDT by ChristianR CLA
Modified: 2023-10-02 05:46 EDT (History)
1 user (show)

See Also:


Attachments
Minimum example for problem reproduction (788 bytes, text/x-java)
2023-04-17 10:00 EDT, ChristianR CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description ChristianR CLA 2023-04-17 10:00:31 EDT
Created attachment 289028 [details]
Minimum example for problem reproduction

I use an AWT canvas for Java2D painting. I am embedding this into an otherwise SWT application. The canvas stays empty on Linux Wayland. Operation on Windows and Linux/GTK is OK. The problem appeared on RCP 4.27 but I saw it also on 4.9.

I attach a minimum example to reproduce the problem which is primarily based on an SWT tutorial, so I think it should use SWT correctly.

The canvas in this example sets a black background which does not appear on Wayland but GTK. I did not retest this minimum example on Windows.

In the original RCP application I am writing I get these errors on the console when I am moving the SWT composite containing the AWT canvas:
Gdk-Message: 15:52:24.677: Window 0x7fa29cd98c80 is a temporary window without parent, application will not be able to position it on screen.

It does not happen here as the canvas is not moved but it might hint to the problem.


I am using Java 17.0.6
I am running on Ubuntu 22.04.2 LTS
The SWT Bundle Version I am using is 3.123.0.v20230220-1431
Comment 1 Iain Young CLA 2023-10-02 03:58:35 EDT
Just adding a comment to say I am also seeing this on RCP 4.24. I am trying to use the AWT canvas to draw some graphs (using SWT_AWT.new_Frame). All works fine on Windows, but on Linux (RedHat 8.3 using Java 11 x64), although I can see the code being executed to draw the graph, it displays nothing other than a blank frame.
Comment 2 ChristianR CLA 2023-10-02 05:46:20 EDT
After I posted the issue, I saw that this bug tracking system is deprecated and created the same issue here:
https://github.com/eclipse-platform/eclipse.platform.swt/issues/635
and posted a workaround.
However I don't even know if anyone has looked for it the past 6 months. There is no wayland label or anything on it yet.

Also if I remember correctly from back then then there is no "Toolkit" for Java with Wayland and it needs to be implemented for any improvement:
https://wiki.openjdk.org/display/wakefield/OpenJDK+Project+Wakefield+-+Wayland+desktop+support+for+JDK+on+Linux
So it is probably no SWT issue but Java/Wayland in general.