hyprwm / xdg-desktop-portal-hyprland

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

Screen sharing not working on Hyprland #189

Closed shayanz23 closed 7 months ago

shayanz23 commented 7 months ago

Hello,

I have an issue where even though the XDG environment variables are set to the right values (atleast it seems like when checking using echo $XDG_SESSION_TYPE and echo $XDG_CURRENT_DESKTOP), it starts xdg-desktop-portal-gtk but not xdg-desktop-portal-hyprland.

I can't figure out how to fix this issue, at first I thought it was because my hyprland config env = XDG_CURRENT_DESKTOP,Hyprland or XDG_CURRENT_DESKTOP=Hyprland in my .bashrc were just applying too late after dbus has already started xdg-desktop-portal-gtk, but using echo I've found that I don't even need to set the XDG variable in the .bashrc or hyperland config, its set to the correct value on its own, but for some reason xdg-desktop-portal-gtk is the only one that starts.

When adding exec-once = /usr/libexec/xdg-desktop-portal-hyprland to the hyprland config, it starts, but when screen capturing, pipewire option still isn't there.

Versions: Fedora 39, Repo version of hyprland 0.35 and xdph 1.3.1-2

My hyprland config file: https://paste.mozilla.org/qo9fnygX

my .bashrc:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# User specific environment
PATH="$HOME/.local/bin:$HOME/bin:/var/lib/flatpak/exports/bin/:~/.local/bin:$PATH"
export PATH

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
    for rc in ~/.bashrc.d/*; do
        if [ -f "$rc" ]; then
            . "$rc"
        fi
    done
fi
unset rc

echo $XDG_CURRENT_DESKTOP command prints: Hyprland

echo $XDG_SESSION_TYPE command prints: wayland

~/.config/xdg-desktop-portal/portals.conf looks like this:

[preferred]
default=Hyprland 
org.freedesktop.impl.portal.Settings=darkman
vaxerski commented 7 months ago

most distros don't accept /usr/libexec. If you've installed xdph manually make sure to follow the readme instructions as they overwrite it to /usr/lib

shayanz23 commented 7 months ago

I installed it using fedora's dnf and it was a dependency for hyprland. btw, I could be wrong, but I think it did work on hyprland 0.34. Because I remember it working at some point when I first installed hyprland.

vaxerski commented 7 months ago

downgrade hyprland and check, then.

shayanz23 commented 7 months ago

I installed 0.34 manually from the repo and tried obs again without my last config, and it worked perfectly.

I switched back to the repo 0.35 version and it worked perfectly, then I added my config file and it still worked perfectly again.

IDK wtf was going on, I did update the ~/.config/xdg-desktop-portal/portals.conf while manually installing the 0.34 version though.

from:

[preferred]
default=Hyprland
org.freedesktop.impl.portal.Settings=darkman

to:

[preferred]
default=hyprland;gtk
org.freedesktop.impl.portal.Settings=darkman

But now it seems to work perfectly, sorry for wasting your time.