Fix seat access selection and provisioning - #4746
Open
VykosMolt wants to merge 2 commits into
Open
Conversation
Arch has two ways of giving a compositor access to the seat: seatd, or systemd-logind. The menu offered "seatd" and "polkit", but polkit is not a seat manager. It is part of the authorization machinery: systemd lists polkit as an optional dependency, and logind checks with it before letting an unprivileged user act, so polkit has to be installed for the logind route to work as intended on Arch. That made it the thing to install, never the thing being chosen. The second option is now called systemd-logind, and SeatAccess carries what each choice actually needs: which packages to install and which services to enable. Configurations written before this still say 'polkit', and are read back as systemd-logind, so a saved choice is not silently discarded. Enabling polkit was doing nothing in any case. Its unit is static, so `systemctl enable polkit` only prints "The unit files have no installation config" and exits 0. The same is true of systemd-logind, which is started on demand, so neither has a service to enable. While the saved value was being read: select_seat_access() handed the stored string to set_default_by_value(), which compares it against menu items holding SeatAccess members. A str is never equal to one, so a previously chosen option was never pre-selected.
The chosen option was stored as a plain string and then used twice: once as a package to install, once as a service to enable. That only worked because the seatd package and the seatd service happen to share a name, and it hid a real bug. Hyprland listed the string under services but never added it to packages, so choosing seatd there ran `systemctl enable seatd` against a target where the package was never installed. That exits 1 with "Unit seatd.service does not exist", and enable_service() turns a non-zero exit into a ServiceException, which stops the installation. Sway, Hyprland, niri and labwc now ask the chosen option what it needs instead of reusing one string for both jobs, so all four behave the same and each installs whatever it enables. The test that covers this runs over every profile and asserts exactly that, so a profile cannot drift apart from the others again the way Hyprland did.
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3467
The seat access setting currently treats
seatdandpolkitas equivalent choices, then reuses the selected string as both a package name and a service name.That causes several problems:
polkitis not a seat manager; the actual alternative toseatdis systemd-logind.polkit.serviceis static, so enabling it does not provision the logind-based path.SeatAccessnow represents the two actual choices,seatdandsystemd-logind, and defines the packages and services required by each.For the logind path,
polkitis installed because it is the optional systemd dependency used for unprivileged authorization, but no static service is explicitly enabled.The four affected desktop profiles now consume the same package/service mapping instead of treating one string as both.
Existing configurations using the old
"polkit"value are migrated to the logind choice. Unknown values are warned about and ignored rather than being passed through as package or service names.Tests cover menu contents and saved-value restoration, legacy migration, package/service provisioning across all affected profiles, and the Hyprland case where the selected seat package was previously missing.
Claude Opus was used for codebase archaeology, implementation assistance, and test review. I manually reviewed and tested the resulting changes.