Several GTK issues on latest Ubuntu release

Christopher Schnick crschnick at xpipe.io
Mon Oct 23 13:05:01 UTC 2023


Hello,

a user of our application xpipe <https://github.com/xpipe-io/xpipe> 
reported several issues after upgrading their Ubuntu version and I 
investigated them myself. I want to note here that these issues are 
exclusive to new Ubuntu versions. I did not observe any of them on 
slightly older Ubuntu versions or other Gnome-based desktop 
environments. I don't know exactly which versions are affected, but 
22.04 works fine and Ubuntu 23.10 does not.

I'm sorry that I'm not able to create fully reproducible examples or dig 
deeper into the causes here, but I'm very constrained on time right now. 
For reproduction, I just installed a new default Ubuntu 23.10 VM and 
launched the JavaFX 21 application straight out of the box.

The first issue is that windows do not retain their information when 
being hidden and then shown again. I.e. after being shown for the second 
time, they will have tiny dimensions and an GTK error is printed to 
stderr about height < 0. For now I temporarily resolve this by doing the 
following, which somehow fixes the issue:

         stage.show();

         // Due to some weird GTK bug, we have to set these sizes every 
time we show a window again even though they have been previously set
         stage.setX(stage.getX());
         stage.setY(stage.getY());
         stage.setWidth(stage.getWidth());
         stage.setHeight(stage.getHeight());

Furthermore, while this is technically not purely JavaFX related, there 
is also a total freeze of the platform thread when it calls 
javax.swing.UIManager.setLookAndFeel as it gets stuck in some GTK 
implementation method. This is called by the fxtrayicon library, which 
calls this method here 
<https://github.com/dustinkredmond/FXTrayIcon/blob/81c99a7357d8f48d9547c0bdb54b848041ce67c6/src/main/java/com/dustinredmond/fxtrayicon/FXTrayIcon.java#L923>. 
Since there is no native JavaFX tray integration, calling these 
awt/swing related methods is quite important for applications trying to 
use the system tray. This was a very unfortunate issue for us as it 
caused applications to not start up at all on affected systems.
I wasn't able to compare the behavior to Ubuntu 22.04 as 
SystemTray.isSupported() returns false on Ubuntu 22.04 but returns true 
on Ubuntu 23.10. Should this even return true on Ubuntu now or is this a 
bug?

Again, these issues only occur on the very latest Ubuntu release. I have 
tested on a lot of other different distros, old and new, and they all 
worked flawlessly.

Best regards, Christopher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231023/069ddc63/attachment.htm>


More information about the openjfx-dev mailing list