Stop the session you started, so the next one can begin
Logging out of plain Hyprland left the desktop running. autostart.lua starts about ten user units, none of them children of the compositor, and the shutdown handler that was meant to stop them stopped hyprland-session.target -- a unit Fedora does not ship. systemctl says 'Unit not found', the handler reports nothing, and hyprpaper, hypridle, vicinae and the polkit agent keep running after logout. Each of them Requires=graphical-session.target, so that target stayed active with no session behind it. The symptom was not a broken Hyprland. Both uwsm and gnome-session refuse to start into a session that is already running, so 'Hyprland (uwsm-managed)' and GNOME both bounced back to the login screen, and plain Hyprland -- which makes no such check -- was the only one that worked. The session that looked healthy was the one leaving the mess, and it was the one Panama tells people not to use. Now stops graphical-session.target, which every one of those units is PartOf, so a unit added to the start handler later cannot be forgotten here. panama-crash-watch had the same leak and no PartOf at all: a journal follower per login, and a 'once per program per session' dedup that had quietly become once per boot.
This commit is contained in:
@@ -91,8 +91,28 @@ hl.on("hyprland.start", function()
|
||||
-- session on its own. Starting it here as well would give you two trays.
|
||||
end)
|
||||
|
||||
-- Tear down what the start handler brought up.
|
||||
--
|
||||
-- This stopped `hyprland-session.target`, which does not exist on Fedora --
|
||||
-- systemctl reports "Unit not found" and the handler achieves nothing. The
|
||||
-- units started above are not children of the compositor, so nothing else
|
||||
-- stopped them either: hyprpaper, hypridle, vicinae and the polkit agent kept
|
||||
-- running after logout, and each one Requires=graphical-session.target, so
|
||||
-- that target stayed active with no session behind it.
|
||||
--
|
||||
-- The next login then failed. Both uwsm and gnome-session refuse to start into
|
||||
-- a session that is already running ("A compositor or graphical-session*
|
||||
-- target is already active!"), so "Hyprland (uwsm-managed)" and GNOME both
|
||||
-- bounced straight back to the login screen while plain Hyprland -- which
|
||||
-- makes no such check -- kept working. The desktop appeared to be the only one
|
||||
-- that functioned, when it was the one leaving the mess.
|
||||
--
|
||||
-- Stopping graphical-session.target is enough on its own: every unit above is
|
||||
-- PartOf= it, so they come down with it, and it carries StopWhenUnneeded=yes.
|
||||
-- It is stopped rather than the units listed individually so that a unit added
|
||||
-- to the start handler later cannot be forgotten here.
|
||||
hl.on("hyprland.shutdown", function()
|
||||
hl.exec_cmd("systemctl --user stop hyprland-session.target")
|
||||
hl.exec_cmd("systemctl --user stop graphical-session.target")
|
||||
end)
|
||||
|
||||
return true
|
||||
|
||||
@@ -5,6 +5,14 @@ Documentation=https://github.com/gibbyb/Panama
|
||||
# the same reason as every other Panama unit: graphical-session.target is
|
||||
# active under GNOME too, and this reports through the Hyprland shell's
|
||||
# notification server.
|
||||
#
|
||||
# PartOf, so it stops with the session that started it. Without it this
|
||||
# outlived logout -- a journal follower per login, accumulating -- and its
|
||||
# "once per program per session" dedup silently became once per boot, which is
|
||||
# the opposite of what it promises: the second crash of the day went unreported
|
||||
# because the first session had already spoken.
|
||||
PartOf=graphical-session.target
|
||||
After=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
Reference in New Issue
Block a user