Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8284516

FileDialog does not adhere to FreeDesktop specifications of opening file

XMLWordPrintable

    • x86_64
    • linux

      ADDITIONAL SYSTEM INFORMATION :
      Fedora 35
      Flatpak
      Java Version: Java 8 (1.8.0_312)

      A DESCRIPTION OF THE PROBLEM :
      The class FileDialog which opens up a native file dialog does not work properly under modern Linux sandbox solutions such as Flatpak.

      Take the following java application https://flathub.org/apps/details/com.atlauncher.ATLauncher .

      This java application has been packaged under a sand-boxed application distribution format called "flatpak".

      "flatpak" isolates applications from accessing the file system outside of the sandbox. Because the sandbox is in effect, while FileDialog will create a respective QT / GTK dialog, it will fail to display any files outside of the sandbox.

      To resolve this limitation with flatpak, the flatpak developers created "portals" (https://flatpak.github.io/xdg-desktop-portal/). These portals allow an application to request features / services from outside of the sandbox. The important one for this issue is opening files.

      The following is the specification for FileChooser:
      https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.FileChooser

      In order to properly resolve this issue, FileDialog will have to check DBUS for the freedesktop portals & then utilize them to create the respective dialog instead.

      All links:
      ATLauncher on FLATHUB: https://flathub.org/apps/details/com.atlauncher.ATLauncher
      ATLauncher on GitHub: https://github.com/ATLauncher/ATLauncher
      Relevant issue: https://github.com/ATLauncher/ATLauncher/issues/564
      xdg-desktop-portal on GitHub: https://github.com/flatpak/xdg-desktop-portal
      xdg-desktop-portal documentation: https://flatpak.github.io/xdg-desktop-portal/#common-conventions


            azvegint Alexander Zvegintsev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: