Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory chooser dialog does not show anything meaningful on Linux #10

Closed
sschuberth opened this issue Jun 6, 2024 · 16 comments · Fixed by #27
Closed

Directory chooser dialog does not show anything meaningful on Linux #10

sschuberth opened this issue Jun 6, 2024 · 16 comments · Fixed by #27
Assignees

Comments

@sschuberth
Copy link

After clicking on "Add build" I get this:

image

So that's not really meaningful 😉

Running on Fedora Linux 40, KDE spin, with Wayland.

@eskatos
Copy link
Member

eskatos commented Jun 7, 2024

Arg, not useful at all indeed.
We simply use JFileChooser and don't have any Swing customisation in the code so I wonder what is causing this.
Could you try changing your KDE/GTK theme to see if it does change something?

@eskatos
Copy link
Member

eskatos commented Jun 7, 2024

Thanks!
FileKit uses the AWT file dialog on Linux and it is quite awful. The other two require lwjgl which is a huge library for that purpose. It feels wrong that this is that complicated to show a file dialog.
I'll give these a try and see

@sschuberth
Copy link
Author

FileKit uses the AWT file dialog on Linux and it is quite awful.

And using FileKit also does not solve the problem, as I've just verified.

For the record, this seems to be the upstream issue.

@eskatos
Copy link
Member

eskatos commented Jun 26, 2024

compose-multiplatform-file-picker repository has been archived yesterday.

Currently this project is unmaintained. If you want an alternative I will recommend FileKit

🤷

@eskatos
Copy link
Member

eskatos commented Jun 26, 2024

This looked like the right solution to this problem but it looks abandoned.

@sschuberth
Copy link
Author

@eskatos
Copy link
Member

eskatos commented Jun 28, 2024

I gave it a try today but

@sschuberth
Copy link
Author

Thanks for reporting those issues upstream, though!

@vinceglb
Copy link

Hi! I'm a contributor of FileKit.

We have just released a new version improving support for Linux on JVM target. Now FileKit uses:

  • XDG Desktop Portal on Linux to select files and folders and save files. You can see the implementation here. AWT File Dialog is used as a fallback if XdgFilePickerPortal is not available.
  • On Windows, FileKit uses JNA to access the native file dialog. Here is the implementation.
  • Same on macOS, we use JNA for accessing the native file dialog. The implementation here.

FileKit contains all the modifications proposed in this PR Wavesonics/compose-multiplatform-file-picker#123

We're still working on improving support on all the platforms. JVM one is probably the most complex to implement 😅

If you decide to give FileKit a try and encounter any issues, don't hesitate to create an issue 👌

I hope it helps!

sschuberth added a commit to oss-review-toolkit/ort-workbench that referenced this issue Jul 18, 2024
The fixes the file dialog to actually work on Linux with Wayland. Also
see a similar discussion at [1].

For now, only the load dialog is implemented, as saving would require
another callback anyway.

[1]: gradle/gradle-client#10

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth
Copy link
Author

Great stuff @vinceglb, that new FileKit version actually works for me!

sschuberth added a commit to oss-review-toolkit/ort-workbench that referenced this issue Jul 18, 2024
The fixes the file dialog to actually work on Linux with Wayland. Also
see a similar discussion at [1].

For now, only the load dialog is implemented, as saving would require
another callback anyway.

Fixes #276.

[1]: gradle/gradle-client#10

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to oss-review-toolkit/ort-workbench that referenced this issue Jul 20, 2024
The fixes the file dialog to actually work on Linux with Wayland. Also
see a similar discussion at [1].

For now, only the load dialog is implemented, as saving would require
another callback anyway.

Fixes #276.

[1]: gradle/gradle-client#10

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@eskatos
Copy link
Member

eskatos commented Aug 6, 2024

Great stuff indeed @vinceglb!
I was able to make use of FileKit in #26

@eskatos eskatos self-assigned this Aug 6, 2024
@eskatos
Copy link
Member

eskatos commented Aug 6, 2024

Actually, I get Directory picker is not supported on Linux yet if XDG Portal is not installed (i.e. no fallback) and picking directories is the only thing we're interested in for this project 😿

I guess we would need at least vinceglb/FileKit#81 before we can adopt this, or do the fallback ourselves which I'm not ready for Today :)

@eskatos eskatos changed the title Directory chooser dialog does not show anything meaningful Directory chooser dialog does not show anything meaningful on Linux Aug 7, 2024
@eskatos
Copy link
Member

eskatos commented Aug 7, 2024

I ended up changing #26 to only use FileKit on Mac and Windows. It's already nicer on these systems.

This doesn't fix this issue though.

A workaround for now is to type or paste a path directly in the field of the file picker if it shows up as in the OP screenshot or in the Gradle Client UI fields of the next screen.

eskatos added a commit that referenced this issue Aug 9, 2024
* Relates to #10
* Using https://github.com/vinceglb/FileKit
* Manually tested release builds (including reaching to hidden
directories)

- ✅  Mac
- ❌  Linux - Not supported, fallback to previous directory picker
- ✅   Windows
@vinceglb
Copy link

I published a new version 0.8.0 of FileKit:

@eskatos
Copy link
Member

eskatos commented Sep 5, 2024

Thank you @vinceglb !

This is working nicely according to my tests on Linux

eskatos added a commit that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants