Fix bug preventing input after the first startup of the container
Xorg was starting before udev could finish the monitor command. This prevented the X server from having access to the input devices. For some reason, any subsequent starts would be fine. Adding a small delay to the X server start and triggering a request for device events from the kernel after a delay seems to fix this issue.
This commit is contained in:
37
overlay/usr/bin/start-xorg.sh
Executable file
37
overlay/usr/bin/start-xorg.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: start-xorg.sh
|
||||
# Project: bin
|
||||
# File Created: Tuesday, 11th January 2022 8:28:52 pm
|
||||
# Author: Josh.5 (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Friday, 6th October 2022 9:21:00 pm
|
||||
# Modified By: Josh.5 (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
# CATCH TERM SIGNAL:
|
||||
_term() {
|
||||
kill -TERM "$xorg_pid" 2>/dev/null
|
||||
}
|
||||
trap _term SIGTERM SIGINT
|
||||
|
||||
|
||||
# EXECUTE PROCESS:
|
||||
# Wait for udev
|
||||
MAX=10
|
||||
CT=0
|
||||
while [ ! -f /tmp/.udev-started ]; do
|
||||
sleep 1
|
||||
CT=$(( CT + 1 ))
|
||||
if [ "$CT" -ge "$MAX" ]; then
|
||||
LOG "FATAL: $0: Gave up waiting for udev server to start"
|
||||
exit 11
|
||||
fi
|
||||
done
|
||||
# Run X server
|
||||
/usr/bin/Xorg -ac -noreset -novtswitch -sharevts -dpi "${DISPLAY_DPI}" +extension "GLX" +extension "RANDR" +extension "RENDER" vt7 "${DISPLAY}" &
|
||||
xorg_pid=$!
|
||||
|
||||
|
||||
# WAIT FOR CHILD PROCESS:
|
||||
wait "$xorg_pid"
|
||||
Reference in New Issue
Block a user