hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
18.59k stars 773 forks source link

Terminating session with `loginctl --terminate-session` causes Hyprland to exit status 1, crashing SDDM #4399

Open pdf opened 6 months ago

pdf commented 6 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit 03ebbe18ed8517ee22591eac82cd54322f42cb7d (props: bump ver to 0.34.0). Date: Mon Jan 1 12:03:15 2024 Tag: v0.34.0 flags: (if any) ```

Bug or Regression?

Bug

Description

Exiting Hyprland by dispatching exit leaves a lot of user-owned processes running (e.g. portals, dbus, keyring helpers, anything that's spawned on login that's not a child of the compositor). However when correctly terminating the session via loginctl --terminate-session Hyprland exits with status 1, which results in the following crash of the SDDM helper:

Authentication error: SDDM::Auth::ERROR_INTERNAL "Process crashed"
Auth: sddm-helper (--socket /tmp/sddm-auth-7cc9f1b0-41fa-49f7-b5cf-f51999c35928 --id 3 --start Hyprland --user pdf) crashed (exit code 1)
Authentication error: SDDM::Auth::ERROR_INTERNAL "Process crashed"
Auth: sddm-helper exited with 1
Signal received: SIGTERM

This results in no display manager, requiring a user to drop to a VT and restart SDDM (when possible - if Hyprland is used as the SDDM Wayland compositor then often this results in a black screen with no interaction possible, requiring a physical power off of the system, that doesn't seem to occur with Weston). That may be an SDDM bug (or might be intended behaviour), but I believe this could be avoided if Hyprland exited cleanly when requested.

How to reproduce

Crash reports, logs, images, videos

No response

DenVorn commented 6 months ago

Got the same problem, whenever I try to exit or terminate my Hyprland session, SDDM crashes.

StandingPadAnimations commented 6 months ago

Same issue here as well. Made a script that closes all windows first before exiting (based on this comment on Reddit):

#!/usr/bin/env fish

# Exit Hyprland gracefully bu closing all programs first
set HYPRCMDS (hyprctl -j clients | jq -j '.[] | "dispatch closewindow address:\(.address); "')
hyprctl --batch "$HYPRCMDS" >> /tmp/hypr/hyprexitwithgrace.log 2>&1
hyprctl dispatch exit

(and yes I use fish, but it should be simple enough to port to Bash)