KnightMurloc / gtk-filechooser-patches

patches for using GtkFileChooserNative via the GtkFileChooserDialog interface.
12 stars 1 forks source link

Flatpak support #2

Open TheLich132 opened 2 years ago

TheLich132 commented 2 years ago

Is it possible to make this patch work with flatpak applications?

KnightMurloc commented 2 years ago

if you installed the program with the --user flag then you can copy the library to $HOME/.local/share/flatpak/app//x86_64/stable//files/lib/ then in the bin folder, rename the executable file to something else and create a bash script (with the name as it was and the executable) with approximately the following content:

#!/bin/sh
LD_PRELOAD=/app/lib/libgtk-3.so.0.2404.30 <executable name>
TheLich132 commented 2 years ago

Doesn't seems to be working...

Tried doing LD_PRELOAD with wrong path and it gave few errors: ERROR: ld.so: object '/app/lib/libgtk-3' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. and with correct path to the file, program started without errors but with default gtk filepicker, so I think it loads the library, but doesn't do anything with it

KnightMurloc commented 2 years ago

what program did you try?

TheLich132 commented 2 years ago

Discord and MS Teams. On both I had same results.

KnightMurloc commented 2 years ago

so. you don't need to use LD_PRELOAD and rename. just copy the library into the libs folder then create two symlinks to it:

ln -s libgtk-3.so.0.2404.30 libgtk-3.so.0
ln -s libgtk-3.so.0.2404.30 libgtk-3.so

I checked with Discord. since MS Teams is also made on electron should also work.

TheLich132 commented 2 years ago

So I should have something like this and that's it? Doesn't have to change anything more? Screenshot_20220902_192202 If yes, then I'm surly doing something wrong, because it's still isn't working. Also my pachted files worked correctly when I tested them with Discord installed from distro repo, so I can use this version if nothing will work.

TheLich132 commented 2 years ago

I have also found a bug. User can't select multiple items in patched filechooser

KnightMurloc commented 2 years ago

reinstall discord and try on a freshly installed one.