hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
305 stars 48 forks source link

No such interface "org.freedesktop.portal.FileChooser" #47

Closed hollowshiroyuki closed 1 year ago

hollowshiroyuki commented 1 year ago

Hi !

I'm trying to use the ImHex editor https://github.com/WerWolv/ImHex in hyprland. As I need the screen sharing feature in discord, I also installed XDPH and it works really nicely, thanks !

But now I'm having a problem when trying to open a file in ImHex, I get this message :

There was an error while opening the file browser:
No such interface "org.freedesktop.portal.FileChooser" on object at path /org/freedesktop/portal/desktop.
This might be caused by your system not having a xdg-desktop-portal backend installed correctly.

I understand that this project is primarily aimed to implement advanced screen sharing on hyperland so the file picker might be out of it's scope, is there a way to configure an external file picker like Nautilus ?

Idrk if this is the right place to ask or if I should go ask an alternative on the ImHex repository ?

vaxerski commented 1 year ago

for that you should install xdg-desktop-portal-gtk which provides a file chooser, but does not conflict with xdph

arminveres commented 5 months ago

Even though I have both installed XDPH and XDPG, I still get the same no such interface error. Further, I also get Failed to request session: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.ScreenCast” when trying to share my screen. I am using NixOS and also tried changing ~/.config/xdg-desktop-portal/hyprland-portals.conf...

fufexan commented 5 months ago

@arminveres please provide more details about your system, or a config repo.

arminveres commented 5 months ago

@fufexan sure, I have it all in my gh repo, more specifically in the home/default.nix and home/modules/hyprland.nix.

fufexan commented 5 months ago

@arminveres https://github.com/arminveres/nix-conf/blob/b7f5d9faa64be9867842b3621bbd833e01aa27f0/home/default.nix#L46 should be inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland. It's not exactly a good idea to mix up flake and Nixpkgs packages.

Edit: I should integrate the HM portal config in the Hyprland module.

arminveres commented 5 months ago

@fufexan sorry, I already tried that as well, didn't push it yet though. Still no change...

fufexan commented 5 months ago

@arminveres can you check whether the interface appears in d-spy? Should look like this. image

arminveres commented 5 months ago

@fufexan it is there image

EDIT: I don't know if it is related, but GTK themes also are not always getting applied, e.g, in D-spy, should be dark, and other gnome based apps.

fufexan commented 5 months ago

I doubt it's related, might be that your theme only applies to GTK 3 and not GTK 4 programs. Try to run dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'".

If the interface appears then it should work. Does it only fail with ImHex, or other programs as well?

arminveres commented 5 months ago

It actually fails with WebCord and Vesktop (both Discord clients) for me. When running xwaylandbridge, it also crashes with some missing org.freedesktop...impl. interface.

fufexan commented 5 months ago

What about trying to open/save a file in firefox?

arminveres commented 5 months ago

Firefox or Signal-Desktop for the matter both work for File picking. Screensharing however does not work inside Firefox.

fufexan commented 5 months ago

Can you enable the Hyprland NixOS module along with xdg.portal.enable = true; and see whether that works?

arminveres commented 5 months ago

I have it already enabled, otherwise GDM does not find Hyprland as a session. But I tried disabling the home managed version to no effect. When xdg.portal.enable is set to true, it requires extra packages to be set, otherwise the build fails.

EDIT: Honestly, it is driving me nuts for no good reason. I remember it worked back on Fedora 40 and all the systemd services are running too.

arminveres commented 5 months ago

For anyone interested, I was able to solve this by moving the xdg.portal configuration from home-manager to nixos modules... it was probably invisible to some system services.

GioPan04 commented 4 months ago

Hi, I'm having the same issue, although I'm on Arch. I have both XDPH and XDPG installed and running, but in programs that uses xdg file opener I get the No such interface "org.freedesktop.portal.FileChooser" error. I'm using the ashpd library to request the file chooser, but I get the same thing if I open firefox with GTK_USE_PORTAL=1 firefox and force firefox to use the xdg implementation of the file chooser

Estebiu commented 4 months ago

I don't know if it's related, but I'm having a brunch of "file-opening" problems recently. Ultimaker Cura segfaults when trying to open a pop-up, zed straight up doesn't do anything when trying to open a folder, and Chromium spits out "No such interface "org.freedesktop.portal.FileChooser" in the logs when opening, but the file picker still works somehow. Again, I'm not as tech-literate as many of you so I'm not sure these all are related, but I just wanted to point that out. I'm gonna try with KDE to see if all there are wlroots/hyprland related or nah

UPDATE: Yeah these all are happening on kde (wayland) too, so I guess they aren't wlroots/hyprland related. Oops.