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

"Open Pack Folder" button does nothing. #1192

Open
1 task done
Kushagra-Srivastava opened this issue Oct 11, 2022 · 12 comments · May be fixed by #1636
Open
1 task done

"Open Pack Folder" button does nothing. #1192

Kushagra-Srivastava opened this issue Oct 11, 2022 · 12 comments · May be fixed by #1636
Labels
bug Something isn't working

Comments

@Kushagra-Srivastava
Copy link

Kushagra-Srivastava commented Oct 11, 2022

Operating System

Linux - Ubuntu 22.04 LTS

Version of PolyMC

PolyMC 1.4.2

Version of Qt

Qt 5.15.6

Description of bug

The "OPEN PACK FOLDER" in game, while adding datapcks to yet-to-be created world, does nothing.

Steps to reproduce

1- open 1.19.2 minecraft with PolyMC
2- click "SINGLEPLAYER"
3- click "DATA PACKS" button
4- Click "OPEN PACK FOLDER" button
5- Nothing happens! (file manager- nautilus in my case- should pop up)

Suspected cause

Totally not a expert. But flatpak permissions maybe?

This issue is unique

  • I have searched the issue tracker and did not find an issue describing my bug.
@Kushagra-Srivastava Kushagra-Srivastava added the bug Something isn't working label Oct 11, 2022
@DioEgizio
Copy link
Contributor

I think this is a bug with your OS

@Kushagra-Srivastava
Copy link
Author

how can it be resolved?? Do you have any idea?

@Scrumplex
Copy link
Contributor

It could also just be the case that the folder didn't exist yet?

@TayouVR
Copy link
Contributor

TayouVR commented Oct 11, 2022

it opens this on windows... I think this is a flatpak permissions issue..
image
might need to make it have access to ~/.temp/ or something.. not sure where mc does it on linux, but should be easy to test.

@binex-dsk
Copy link
Collaborator

Does xdg-open open the folder? Make sure your XDG settings are correct.

@Nik-mmzd
Copy link
Contributor

Nik-mmzd commented Jan 9, 2024

I have the same problem. ArchLinux, latest PolyMC release from AUR (built from source) (I also tried the flatpak version with the same result), no "open directory" buttons work. No problems with other programs, xdg-open works fine.
It looks like Prism has the same problem and tries to fix it (at least for non-flatpak users) by removing the legacy MultiMC indirectOpen workaround in launcher/DesktopServices.cpp completely (see PR 1954 from their repo).
It looks like this workaround is really obsolete: I can't find it in other popular programs, like QBittorrent.

P.S. Flatpak support can be a pain: in my project I had to implement DBus support (org.freedesktop.portal.Desktop, OpenDirectory method) to open folders from a flatpak installation with correct mappings to host filesystem. The problem is OpenURI XDG-Portal method (seems to be used by QT) does not support file:// schema, you required to use OpenFile/OpenDirectory methods

@binex-dsk
Copy link
Collaborator

Interesting. I'm very busy but i'll take a gander at it within the next week or so.

@Nik-mmzd
Copy link
Contributor

Nik-mmzd commented Jan 10, 2024

I have compiled PolyMC with the removed indirectOpen workaround and can confirm that it fixes the "Open Folder" buttons for non-flatpak installations.

I tried searching QT sources and found that it uses the OpenURL and OpenFile XDG Portal methods but doesn't care about OpenDirectory, but you can use their implementation of the OpenFile call as a reference

@binex-dsk
Copy link
Collaborator

that it fixes the "Open Folder" buttons for non-flatpak installations.

I'd much rather find a fix that works for both flatpak and non-flatpak installations.

@Nik-mmzd
Copy link
Contributor

The only way to support Flatpak is to implement the OpenDirectory call by yourself (or find an external dependency?) with the QDesktopServices::openUrl call as a fallback for non-DBus non-Flatpak installations.

@Nik-mmzd
Copy link
Contributor

Nik-mmzd commented Jan 11, 2024

Good news: I was wrong about Flatpak support. This patch works for Flatpak installations as well.
image

I can spend some time, apply the full patch from the Prism repo and submit here as a PR
You can check the patch in my fork

@binex-dsk
Copy link
Collaborator

Awesome. Open a PR here and I and others will review it.

@Nik-mmzd Nik-mmzd linked a pull request Jan 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants