allow signaling a parent process that the screen was locked #637
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.
(partially) fixes #633
Hi!
I've recently tried out hyprlock and it works nicely with my setup! (using Wayfire mostly) However, I also noticed the issue reported in #633 and I think it is mainly caused by not being able to delay suspend until the screen is locked.
This patch adds two (related) ways to signal to a parent process when the screen has been locked:
-R
/--ready-fd
option. Similar functionality exists in swaylock.fork()
) and waiting until it locks the screen (-D
/--daemonize
option). This ensures that when the parent process exits, the screen is locked. This is equivalent to the-fork-on-lock
option in waylock or the-f
/--daemonize
option of swaylock.Using the second option and e.g. swayidle, it can be ensured that the screen is locked before suspend:
The first option can be tested e.g. with the screenlocker proxy service I'm working on:
https://github.com/dkondor/wayland-screenlock-proxy/tree/hyprlock
Caveats / TODO:
-w
option in swayidle unless I'm missing something)no_fade_in = true
is set in the config, since it signals success immediately when getting the locked event. I looked into how the fade-in animation is managed, and seems I would need to check whenbga == 1
here, but I'm unsure how to get this information to theCHyprlock
class yet.-D
and-R
is given, the latter is ignored); not sure if this should be an error, or the worked around to still signal the fd given to-R