Open fyrk opened 1 week ago
I kind of experienced weirdness with xdg-desktop-portal as well, but it was very inconsistent and nonreproducible, and seemed to still manifest when i reverted the changes; which was very weird, why would this break now? as such, i naively assumed that this regression on my system was unrelated to the changes to niri-flake...
I've tested with flatpak like you showed, and the change you made does indeed seem to fix the issue. I've added it in a new commit https://github.com/sodiboo/niri-flake/commit/318b1ef1b47bc30dddd0b14b0a8a2093039e275a. In general, my system works fine now, but one very peculiar oddity remains:
xdg-desktop-portal
consistently starts about 2 seconds before graphical-session.target
. It is also PartOf=graphical-session.target
but not After=
, and in my mind, this should make sense, because theoretically both niri-flake-polkit and xdg-desktop-portal (and, of course, niri itself) contributes to the graphical session environment. This target is meant to be Before
any graphical applications like waybar and swaybg,.. and they work fine... except my waybar now waits for xdg-desktop-portal, which fails to start. eventually, it will restart after total failure, at which point WAYLAND_DISPLAY
is available to the graphical-session.target
and xdg-desktop-portal will start without issue within <1s... but this in itself takes like 1 minute before it restarts...
so... uh... in theory i'd want xdg-desktop-portal
to start After=graphical-session.target
, just like niri-flake-polkit
? but i can't really touch the xdg-desktop-portal
and the flatpak people who designed it are probably way more knowledgeable of how this should work than me and this leads me to believe what niri-flake-polkit was doing is "supposed" to be the correct way... but obviously that doesn't work as-is.
systemd is giving me massive headaches. god this sucks. cc @YaLTeR do you have any idea what do? this shouldn't be nixos-specific and honestly at this point given the interaction i described with xdg-desktop-portal, i give it 50/50 odds that this might actually be a problem with niri's session handling? probably not, since it seems to work just fine on every other distro, but like,,, what else could it be? do you know why xdg-desktop-portal
starts 2 seconds before graphical-session.target
? (also, niri.service
status logs are timestamped to the same as graphical-session.target
, including the one logging the Wayland socket name; so xdg-desktop-portal
is trying to start before niri started)
ok systemd is definitely playing a sick fucking joke on me because i set up a BEAUTIFUL little watch
window that starts with niri so i could record this to show it happening and OF COURSE now when i wanted to show it off, the xdg-desktop-portal behaves just fine
anywhow, TLDR, current symptoms: everything Works Technically, it just sometimes takes about 2 minutes to start xdg-desktop-portal (but there is no delay when i wanted to record it)
I think systemd-analyze should have some dependency analysis tools, maybe those can help?
anywhow, TLDR, current symptoms: everything Works Technically, it just sometimes takes about 2 minutes to start xdg-desktop-portal (but there is no delay when i wanted to record it)
Sounds like what I'm experiencing; xdg-portal accesses will just time out after some logins, causing waybar to start delayed, apps to look weird because of missing settings, etc.
One wild guess: During some logouts, xdg-desktop-portal will first stop, and then immediately start during that same second. It's weird, why would it start again during logout? If I then log in quickly (not sure if "quickly" is actually required...), Portals won't work properly. Does that happen for you, too?
The fix for #348 in fd00de202cc0287f7b34c237b8585e67fe7b85f7 seems to break XDG Portals from within Flatpak on my machine. For example, clicking on a link inside a Flatpak app or opening an attachment in Evolution installed as Flatpak no longer works.
This can be reproduced by running
xdg-open
from within a Flatpak sandox:which will produce the following Journal:
It works if I re-add
to my config.