Created attachment 1784005 [details] Test that Executes the Desktop... outside of AET Description of problem: Java Desktop.getDesktop( ).browse( URI ) only goes to the Browser after an Application exits. This did work with Fedora 33, started after Upgrade to 34. I tried Java 1.8.0 openjdk, Java 11 openjdk and Oracle Java 1.8.0_202, the behavious is always the same. I stepped into it until classloader.findNative, where it finds /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.fc34.x86_64/jre/lib/amd64/libawt_xawt.so and calls Java_sun_awt_X11_XDesktopPeer_gnome_1url_1show. Version-Release number of selected component (if applicable): Fedora 34 (Workstation Edition) java-1.8.0-openjdk-devel-1.8.0.292.b10-0.fc34.x86_64 java-11-openjdk-devel-11.0.11.0.9-0.fc34.x86_64 How reproducible: Call Desktop.getDesktop( ).browse( URI ) from a Java Program. Steps to Reproduce: 1. Compile attached Java Source 1.1 one runs the Desktop.getDestop in AET, the other outsise of AET 1.1.1 just see I can only add one Attachment; will try to add the second test after Submission 2. Run Actual results: The Browser opens after the Program terminates Expected results: The Browser should open while the Program is still running Additional info:
Created attachment 1784006 [details] Test that executes Desktop... from within AET
Forgot to mention :( I'm using the Gnome Desktop and tried with Xorg and Wayland. I recognized the Problem when using an Application that uses the KeycloakInstalled-Adapter loginDesktop which stopped working after Updating from Fedora 33 to 34.
It sounds more like gnome 40 issue.
*** Bug 1966176 has been marked as a duplicate of this bug. ***
*** Bug 1965832 has been marked as a duplicate of this bug. ***
Adding more details in case someone takes this critical bug. The Desktop.open() call hangs too, but only in some conditions. If the associated application is gedit or GNOME Builder, for example a .txt or .sql file, the application open immediately. In the case of Evince (.pdf) or LibreOffice (.ods) the call hangs and the document is opened at the end of the Java process. Java 11 presents the problem too. It could be a GNOME bug or an improper use of GNOME APIs by Java that wasn't triggered before GNOME 40.
Confirmed as a non Java bug. Build next attachment with: gcc -Wno-deprecated-declarations `pkg-config --cflags gtk+-3.0` -o example example.c `pkg-config --libs gtk+-3.0`. Invoke as ./example file:///...path_to.pdf The example replicate the steps Java does at https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/native/libawt_xawt/xawt/awt_Desktop.c#L84 Commenting the gdk_threads_enter() and gdk_threads_leave() doesn't change anything.
Created attachment 1826030 [details] C based test
Reported at upstream GTK at https://gitlab.gnome.org/GNOME/gtk/-/issues/4278
Upstream GTK issue reports that a GTK main loop is needed and my C based test was updated to add it and then gtk_show_uri started to work. For what I see in OpenJDK codebase, doesn't have a permanent GTK main loop. It start one on demand when needed, for example when opening a native GTK FileDialog [1] The next example attachment shows the problem from the Java side. If Test is invoked with one argument, being it the PDF file URI like file:///path_to_pdf.pdf, the process must end after the final 10 seconds timeout for the PDF to open, but if it is invoked with two arguments like: --dialog file:///path_to_pdf.pdf The PDF is opened immediately, because a FileDialog instance is opened concurrently and that means a GTK main loop is running. [1] https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c#L418
Created attachment 1834393 [details] Updated test
Thanks for this, Robert! I've reported it upstream to OpenJDK as: https://bugs.openjdk.java.net/browse/JDK-8275494
Since the OpenJDK bug isn't open to everyone I want to add this: There are other alternative solutions that may not involve loading a native library. The most simple of them is to invoke the standard /usr/bin/xdg-open command. Another option is to implement the XDG Shared MIME-info Database specification, but that is more code to maintain and could have other implications, like opened applications inheriting the current application environment, something that doesn't happen when using xdg-open, at least on a GNOME session.
This message is a reminder that Fedora Linux 34 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '34'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 34 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
This message is a reminder that Fedora Linux 35 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '35'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 35 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13. Fedora Linux 35 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.