Skip to content

Conversation

calestyo
Copy link

@calestyo calestyo commented Sep 19, 2025

Hey there.

This will be needed for linuxmint/cinnamon#13108.

Please review (I'm not really a JS guy and completely new to Cinnamon's codebase).

Thanks,
Chris.

An enum cannot be used here, as it should be possible to give a list of values
which are tried in order until one of the actions can actually be used (all but
`cancel` may not be available).

The chosen default value leaves the current behaviour of defaulting to
`shutdown` and apart from that orders as follows:
• `cancel`, because it’s always available and safe (nothing happens).
• `suspend` and `hibernate`, because they’re both safe (mostly nothing should
  get lost, unless one does things like downloading or burning an optical
  medium).
  `suspend` before `hibernate` as the former is faster and `hibernate` might be
  less likely available (it needs a sufficiently large swap active).
• `restart`, because – just like `shutdown` – it may lead to loosing data.

Signed-off-by: Christoph Anton Mitterer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant