Scale window correctly

This commit is contained in:
2026-01-05 16:35:27 +01:00
parent 864aeb86eb
commit 3fb95fe7a8
5 changed files with 45 additions and 51 deletions

View File

@@ -18,14 +18,14 @@ done
echo "Using DISPLAY=:$DISP"
Xephyr ":$DISP" -screen "$SCREEN" -resizeable -ac &
XEPHYR_PID=$!
cleanup() {
kill "$ELECTRON_PID" "$OPENBOX_PID" "$XEPHYR_PID" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
Xephyr ":$DISP" -screen "$SCREEN" -resizeable -ac &
XEPHYR_PID=$!
sleep 1
DISPLAY=":$DISP" openbox &
@@ -35,12 +35,23 @@ sleep 0.5
DISPLAY=":$DISP" electron "$APP_ENTRY" &
ELECTRON_PID=$!
DISPLAY=":$DISP" xsetroot -solid "#009999"
while :; do
if ! kill -0 "$ELECTRON_PID" 2>/dev/null; then
echo "Electron exited — killing Xephyr"
kill "$XEPHYR_PID" 2>/dev/null || true
break
fi
if ! kill -0 "$XEPHYR_PID" 2>/dev/null; then
echo "Xephyr exited — killing Electron"
kill "$ELECTRON_PID" 2>/dev/null || true
break
fi
# monitor X server — when it dies, kill Electron
while kill -0 "$XEPHYR_PID" 2>/dev/null; do
sleep 0.5
done
echo "Xephyr exited — killing Electron"
kill "$ELECTRON_PID" 2>/dev/null || true
wait "$ELECTRON_PID" 2>/dev/null || true
wait "$XEPHYR_PID" 2>/dev/null || true