Add ability to show and hide buttons - #99
Conversation
|
@Ly-sec may I asks for a review, please? |
iwasironman
left a comment
There was a problem hiding this comment.
I am new to contributing to open source but have been a dev for a long time. There are some changes I would like to see in this project so I am trying to contribute. Since a review was asked for by a maintainer, here is a review that might help the maintainers. I don't know what the community's process is for these things so i am just jumping in. Tell me if I should be doing this differently. Thanks
- Two config keys for the same setting. The PR adds both session.show_selector and ui.show_session_selector, both parsed, both written back, with ui.* silently winning:
greeter_preferences.cpp — sessionShowSelector is applied, then uiShowSessionSelector overwrites it four lines later. Undocumented precedence.
And the docs disagree with each other about which one is real:
- README.md → only documents ui.show_session_selector
- nix/nixos-module.nix example → only shows session.show_selector = false
- examples/greeter.toml → ships both, both set to true
Neither key has shipped yet, so there's no compat argument. Drop session.show_selector entirely, keep [ui], fix the nix example.
- Unrelated behavior change bundled in
layoutPowerButtons and rebuildFocusRing now gate on power::hasSyncedAction(...). That is not part of "show/hide buttons" — it's a fix for a real pre-existing bug: applySyncedPowerButton sets visibility at construction (greeter_surface.cpp:562), but main's layoutPowerButtons calls btn->setVisible(true) unconditionally on every layout, re-showing buttons that sync said to hide. So the fix is correct and welcome — it just needs to be its own commit and mentioned in the description, because it changes behavior for anyone using synced power actions.
Related: the compound condition m_showShutdownButton && power::hasSyncedAction("shutdown") is now duplicated in two places (layout + focus ring), and a third variant lives in the ctor. The PR already introduced showsSessionSelector() / showsThemeSelector() accessors — do the same for showsShutdownButton() / showsRebootButton() / showsFirmwareButton() instead of repeating the expression. Drift risk otherwise.
- [ui] is silently accepted and then destroyed in sync.toml
parseSync delegates to parseConfig (greeter_config_io.cpp:691), so adding "ui" to isKnownTopLevelKey means a [ui] table in sync.toml parses with no warning, is ignored, and gets erased on the next sync write. Low severity, but silent key deletion is unfriendly — either warn on [ui] in sync.toml or say plainly in the docs it's greeter.toml-only.
- Naming / placement
Existing config uses appearance.hide_logo — negative, and under [appearance]. The PR uses show_* under a brand-new [ui]. Now visibility toggles live in two sections with opposite polarity. Not fatal, but worth a maintainer decision now rather than after release.
|
@iwasironman you comment definitely makes sense. I'll fix those, thanks! |
|
Sadly I totally missed this PR I'm very sorry. I did merge #103 so you will have to fix the conflicts. I do agree with @iwasironman there are some things that need to be solved first before I'd be willing to merge it @denqxotl |
Summary
Added configurable visibility for the session selector, theme selector, and individual power buttons.
Motivation
Allows users to simplify the greeter UI and hide controls they do not need, while preserving existing defaults and session selection priority.
Type of Change
Related Issue
None.
Testing
meson compile -C buildgit diff --checkmeson test -C buildreports that no tests are defined.Manual Coverage
just run/just run-local(dev compositor)Sync Now)programs.noctalia-greeter)[output].name[output].layout/[output].transformsScreenshots / Videos
Checklist
AGENTS.mdandREADME.md.just formatwith clang-format v22+ installed, or this PR has no code changes.Additional Notes
New configuration options are located under
[ui]: