Closed luispabon closed 3 years ago
Ah, yeah. When -f
is used, the original process forks and exits once it has created the window; when --fade-in
is used, the window is initially created with the image without effects applied. That means it creates the window with all content still visible, then the system is suspended before the animation gets time to complete.
For the time being, you can fix this in one of two ways:
before-sleep
command to swaylock -f -c 000000 -i $lock_bg --fade-in 0
. This will override the config file's fade-in=0.2
.before-sleep
command to swaylock -f -c 000000 -i $lock_bg; sleep 1
.The eventual solution will be for me to change the logic of when forking happens to be after the fade animation is complete.
Thank you, I've disabled fading on suspend for now as suggested. You want me to keep this open to track any future fixes to it?
Yeah sure, let's keep this issue opened until it's fixed :)
:ok_hand:
@luispabon Maybe this could help you, I worked around this issue I've written this this script. The script is free to use. It allows enabling or disabling fade-in (or grace, which can be more fatal) very easy depending on why the screen will be locked.
Also it disables a running fade-in by killing the old swaylock process and launching another one. I'm using this to prevent a running grace period and fade-in after resuming from sleep.
Cheers @Zocker1999NET for the workaround :+1:
Ok, so after https://github.com/mortie/swaylock-effects/commit/03bbbd3ad1be9fb1dda567678a61862e24c0bb37, this issue should be resolved. With -f
, the parent process should now only exit once the fade-in is done.
Is there a way to use this from the config itself, that is, not entering that as a flag?
Given the config below with a 0.2s fade in, when I suspend my laptop the animation doesn't complete before the laptop actually goes into sleep. I'm not entirely sure how to avoid this. The animation completes after the laptop resumes from suspension.
The main take away here is that screen contents aren't obfuscated and are visible for a few seconds after resuming.
Vid: https://www.youtube.com/watch?v=pBpErmBESo4
Sway config:
Swaylock-effects config: