NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.08k forks source link

plasma on wayland: legacy X11 apps fail to autostart due to missing X11 server but start flawlessly after plasma gets initialized #225605

Open pshirshov opened 1 year ago

pshirshov commented 1 year ago

Sometimes all the legacy X11 apps from my .desktop files in the XDG autostart directory fail to start when I log into a plasma wayland session due to missing X11 server:

Apr 10 18:19:18 pavel-nix systemd[3812]: app-skypeforlinux@autostart.service: Failed with result 'core-dump'.
Apr 10 18:19:18 pavel-nix element-desktop[152129]: [152129:0410/181918.273372:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
Apr 10 18:19:18 pavel-nix element-desktop[152129]: [152129:0410/181918.273423:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
Apr 10 18:19:18 pavel-nix element-desktop[152129]: The futex facility returned an unexpected error code.
Apr 10 18:19:18 pavel-nix systemd-coredump[152385]: [🡕] Process 152129 (.electron-wrapp) of user 1000 dumped core.

Though I can flawlessly launch them manually.

Probably either DISPLAY environment variable isn't being initialized or there is some kind of a race condition/missing dependency.

Usually everything works well after reboot but doesn't work after I log out of the session and log in back, so I'm inclined to think that that's a race condition.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.23, NixOS, 23.05 (Stoat)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(root): `"nixos-21.11pre333218.263ef4cc414, home-manager"`
 - channels(pavel): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
apfelkuchen6 commented 1 year ago

Did you disable services.xserver.desktopManager.plasma5.runUsingSystemd?

pshirshov commented 1 year ago

I didn't change that setting. Should I?

pshirshov commented 1 year ago

Hmm. It definitely looks like setting this option to false fixes the issue. Is it something expected/well known?.. Why it's not a default value then?

apfelkuchen6 commented 1 year ago

I was more expecting it to work with systemd, but not with the old startup code. AFAIK systemd startup is also the upstream default.

huantianad commented 1 year ago

I wonder if this is similar to the issues I've had with applications that use a tray icon not working if they're autostarted, as the system tray doesn't exist yet. The Qt docs suggest that that shouldn't be an issue, but no idea.

pshirshov commented 1 year ago

¯\_(ツ)_/¯