Skip to content

fix: give the power key back to logind while cosmic-comp is frozen - #241

Open
LinuxBoy-96 wants to merge 1 commit into
pop-os:masterfrom
LinuxBoy-96:C45
Open

LinuxBoy-96 wants to merge 1 commit into
pop-os:masterfrom
LinuxBoy-96:C45

Conversation

@LinuxBoy-96

@LinuxBoy-96 LinuxBoy-96 commented Nov 8, 2026 •

Copy link
Copy Markdown

cosmic-session blocks logind's power key handling for the whole session, and cosmic-comp handles the key. While cosmic-comp is frozen, the power button does nothing, so a hard reset is the only way out.

cosmic-session now sends a heartbeat every 2 s, one at a time. When cosmic-comp doesn't answer for 10 s, the inhibitor is closed, so a short press of the power button does a clean poweroff through logind. It's taken again as soon as cosmic-comp answers. A cosmic-comp that never answers (an older version) keeps the inhibitor and only gets one message.

Needs pop-os/cosmic-comp#. Related: pop-os/cosmic-comp#, which aborts cosmic-comp after 60 s frozen.

Tested with cosmic-comp nested in Xvfb and a fake logind: with the main thread held for 30 s, the inhibitor was closed after 10 s and taken again as soon as cosmic-comp answered.

Needs pop-os/cosmic-comp#3045. Related: pop-os/cosmic-comp#3044, which aborts cosmic-comp after 60 s frozen.


  • I have not included any LLM (also known as AI) generated content in this PR, including code, comments, and descriptions.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.
  • I have read and followed all of the above requirements. For more information, see our contributor guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant