-
Notifications
You must be signed in to change notification settings - Fork 816
[WIP] Add native screensaver #13432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[WIP] Add native screensaver #13432
Conversation
callback. This lets us more easily control what keybindings are available in a given 'mode'. Assign modes to various states - expo, overview, etc...
- Re-uses PAM mechanisms from cinnamon-screensaver - Functional in wayland or x11 - Add a native 'away message' dialog - Unify 'show-greeter' code from multiple sources - Add systemd/consolekit support for session states - Provide cinnamon-screensaver-command (still utilized by csd- power for pre-power-event activation). - debian/control: Provide cinnamon-screensaver - Remove cinnamaon-screensaver as a required session component. - Unify mpris code for the sound applet and albumArtWidget.js TODO: - Notification monitor (for feature parity with cinnamon-screensaver). - Wallpaper in wayland sessions - Fallback locker. - fprintd testing - debian/control fixes to allow replacement of cinnamon-screensaver during upgrade (cinnamon will now Provide cinnamon-screensaver). Imported from cinnamon-screensaver: - pam.d files - src/screensaver/* - src/cinnamon-screensaver-pam-helper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a native screensaver implementation to Cinnamon, migrating functionality from the external cinnamon-screensaver daemon into Cinnamon itself. The implementation reuses PAM authentication mechanisms and provides feature parity for both X11 and Wayland sessions.
Changes:
- Integrated PAM authentication with native unlock dialog and away message support
- Implemented screensaver widgets (clock, album art with MPRIS control, power/battery indicator)
- Added action modes system for keybinding context management during lock/unlock states
- Unified MPRIS and power utility modules for sharing between sound applet and screensaver
- Updated session files, packaging, and applets to use internal screensaver
Reviewed changes
Copilot reviewed 57 out of 59 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| src/screensaver/*.{c,h} | PAM authentication, setuid handling, subprocess management (imported from cinnamon-screensaver) |
| src/cinnamon-screensaver-pam-helper.c | PAM helper subprocess for authentication |
| js/ui/screenShield.js | Main screensaver coordinator with widget floating system and state management |
| js/ui/unlockDialog.js | Unlock dialog UI with password entry and user switching |
| js/ui/awayMessageDialog.js | Modal dialog for setting away message before locking |
| js/ui/screensaverWidgets/*.js | Floating widgets for clock, album art, and power display |
| js/misc/{authClient,loginManager,mprisPlayer,powerUtils}.js | Infrastructure modules for authentication, session management, and shared utilities |
| js/ui/main.js | Action mode system for keybinding filtering based on screen state |
| js/ui/keybindings.js | Action mode support for keybindings |
| files/usr/share/cinnamon/cinnamon-screensaver-command/*.py | Replacement screensaver command tool using DBus |
| data/pam/*.pam | PAM configuration files for authentication |
| debian/* | Packaging changes to provide cinnamon-screensaver and add PAM dependencies |
| *.session.in | Removed cinnamon-screensaver as required session component |
| data/theme/cinnamon-sass/widgets/_screensaver.scss | Styling for screensaver widgets and unlock dialog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| return FALSE; | ||
| } | ||
| return FALSE; |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable code: this return statement will never be executed because all paths above either return TRUE or FALSE via goto out.
| data->closure->cb_data); | ||
| data->should_interrupt_stack = res == FALSE; | ||
|
|
||
| g_printerr ("should interrupt: %d\n", data->should_interrupt_stack); |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent use of g_printerr for debug output. This function uses global.log elsewhere but switches to g_printerr here. Consider using consistent logging throughout for better log management and filtering.
|
|
||
| // Look up the binding in our keybinding manager | ||
| let bindingName = binding.get_name(); | ||
| let [action_id, entry] = Main.keybindingManager._lookupEntry(bindingName); |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable action_id.
|
|
||
| // Get widget's preferred size | ||
| let [minWidth, natWidth] = widget.get_preferred_width(-1); | ||
| let [minHeight, natHeight] = widget.get_preferred_height(natWidth); |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial value of minHeight is unused, since it is always overwritten.
|
|
||
| // If we constrained width, recalculate height with new width | ||
| if (widgetWidth < natWidth) { | ||
| [minHeight, natHeight] = widget.get_preferred_height(widgetWidth); |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value assigned to minHeight here is unused.
| #!/usr/bin/python3 | ||
|
|
||
| from gi.repository import GLib, Gio | ||
| import sys |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'sys' is not used.
| import sys |
| print("cinnamon-screensaver-command (Cinnamon %s)" % version.unpack()) | ||
| else: | ||
| print("cinnamon-screensaver-command (Cinnamon version unknown)") | ||
| except: |
Copilot
AI
Jan 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except block directly handles BaseException.
| except: | |
| except Exception: |
|
/generate-test-packages |
|
Test packages generated successfully! Download from the workflow run (available for 7 days). |
power for pre-power-event activation).
TODO:
during upgrade (cinnamon will now Provide cinnamon-screensaver).
Imported from cinnamon-screensaver: