mirror of
https://git.adityakumar.xyz/betterlockscreen-openrc.git
synced 2024-11-21 22:52:52 +00:00
Run prelock and postlock synchronously to avoid race condition
As reported in issue #285, running postlock in a subshell and immediately returning from lockselect() has a high chance of hitting `exit 0` before xset and dunstctl get a chance to execute. Run both prelock and postlock synchronously within lockselect().
This commit is contained in:
parent
c625f8b8a1
commit
1093ce51e6
1 changed files with 2 additions and 2 deletions
|
@ -278,7 +278,7 @@ postlock() {
|
||||||
lockselect() {
|
lockselect() {
|
||||||
|
|
||||||
echof act "Running prelock..."
|
echof act "Running prelock..."
|
||||||
prelock &
|
prelock
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
dim) if [ -f "$CUR_L_DIM" ]; then lock "$CUR_L_DIM"; else failsafe; fi ;;
|
dim) if [ -f "$CUR_L_DIM" ]; then lock "$CUR_L_DIM"; else failsafe; fi ;;
|
||||||
|
@ -291,7 +291,7 @@ lockselect() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echof act "Running postlock..."
|
echof act "Running postlock..."
|
||||||
postlock &
|
postlock
|
||||||
}
|
}
|
||||||
|
|
||||||
# calculate adjustments for hidpi displays
|
# calculate adjustments for hidpi displays
|
||||||
|
|
Loading…
Reference in a new issue