diff --git a/opt/le-multiterminal/multiseat-controller.sh b/opt/le-multiterminal/multiseat-controller.sh index 01e54bb7b73f7f2e6c302af0d43e3c4b0a48ffca..180c105087803b03a1c4af4998ef490640672122 100755 --- a/opt/le-multiterminal/multiseat-controller.sh +++ b/opt/le-multiterminal/multiseat-controller.sh @@ -65,6 +65,20 @@ create_onboard_window () { export DISPLAY=${DISPLAY_XORGS[$WINDOW_COUNTER]} Xorg ${DISPLAY_XORGS[$WINDOW_COUNTER]} & + pid=$! + + # Guarantees the Xorg execution + xdpyinfo -display ${DISPLAY_XORGS[$WINDOW_COUNTER]} + EXIT_CODE=$? + while [[ $EXIT_CODE -ne 0 ]]; do + sleep 0.5 + xdpyinfo -display ${DISPLAY_XORGS[$WINDOW_COUNTER]} + EXIT_CODE=$? + if ! kill -0 "${pid}" >/dev/null 2>&1; then + Xorg ${DISPLAY_XORGS[$WINDOW_COUNTER]} & + pid=$! + fi + done $CREATE_WINDOW @@ -85,9 +99,24 @@ create_secundarycard_windows () { # Run Xephyr to type in this output Xephyr ${DISPLAY_XORGS[$WINDOW_COUNTER]} -output $i -noxv & + pid=$! + + # Guarantees the Xephyr execution + xdpyinfo -display ${DISPLAY_XORGS[$WINDOW_COUNTER]} + EXIT_CODE=$? + while [[ $EXIT_CODE -ne 0 ]]; do + sleep 0.5 + xdpyinfo -display ${DISPLAY_XORGS[$WINDOW_COUNTER]} + EXIT_CODE=$? + if ! kill -0 "${pid}" >/dev/null 2>&1; then + Xephyr ${DISPLAY_XORGS[$WINDOW_COUNTER]} -output $i -noxv & + pid=$! + fi + done # Export display and create a window to write on this output export DISPLAY=${DISPLAY_XORGS[$WINDOW_COUNTER]} + $CREATE_WINDOW # Again: the fake_seat display needs to be exported @@ -120,6 +149,7 @@ kill_jobs () { ############ BEGIN ############ +# Guarantees the fake-seat execution, used to access the secondary board Xorg $FAKE_DISPLAY -seat __fake-seat-1__ -dpms -s 0 -nocursor & pid=$!