fix: put the popup close button in the dock, and clear the printer location
Three things, none of them redesigns. The close affordance for a secondary Chrome window was a separate layer-shell surface anchored to that window's corner, repositioned by a five-per-second poll. Any position change tore the surface down and built another, so on real hardware it chased the window and flickered. Removed entirely: the GTK button process, the geometry maths that placed it, the --close-button mode that spawned it, and the poll loop that drove it. The window helper no longer imports GTK at all. The behaviour underneath it was right and is kept. The first Chrome top-level is the classroom browser, tiled and borderless; later ones float centred at about three quarters of the output. Creation order is the only thing that can tell them apart — confirmed on a real session, where every Chrome top-level shares app_id, shell, PID and a null transient_for, and sway exposes no window properties for Wayland toplevels at all. Titles are still not used. It now follows sway's own window events instead of polling, so dragging a popup costs nothing. Close moved into the dock, which was already on screen and does not move, so it cannot chase anything. It appears only while a secondary window is focused and runs kill on that one container. The helper publishes which window that is; the dock watches the file rather than polling. A stock sway title bar has no close button, so restoring the border would not have solved this either. Two bugs found by looking rather than by testing state. Chrome renegotiates the size of a popup opened with explicit dimensions after the resize returns, which left windows centred for a width they no longer had; placement now settles and repeats once, at creation only, so dragging is still free. And the dock's Close button came up empty because show_all does not recurse into a no-show-all widget. The printer's Location is now blank. CUPS prints it under the queue name in every dialog, so "Ekklesia Classroom" was a second line the teacher had to read past; the identity is one word. The already-configured check includes Location, so a machine set up before this is corrected rather than left as close enough. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
a1d8150d7c
commit
f65c814eff
@@ -29,23 +29,63 @@ if [[ -n "$previous" ]]; then
|
||||
docker_args+=( -v "$previous:/packages/previous.deb:ro" )
|
||||
fi
|
||||
|
||||
docker "${docker_args[@]}" debian:trixie-slim \
|
||||
timeout --signal=TERM --kill-after=15s 720s \
|
||||
docker "${docker_args[@]}" debian:trixie-slim \
|
||||
bash -s -- "${previous:+/packages/previous.deb}" <<'CONTAINER'
|
||||
set -euo pipefail
|
||||
set -Eeuo pipefail
|
||||
|
||||
validation_failure() {
|
||||
status=$?
|
||||
echo "Validation failed at line ${BASH_LINENO[0]}: ${BASH_COMMAND}" >&2
|
||||
|
||||
if command -v lpstat >/dev/null 2>&1; then
|
||||
lpstat -t >&2 || true
|
||||
lpoptions -p Elmer -l >&2 || true
|
||||
fi
|
||||
|
||||
[[ ! -f /tmp/provision-first.log ]] || cat /tmp/provision-first.log >&2
|
||||
[[ ! -f /tmp/provision-second.log ]] || cat /tmp/provision-second.log >&2
|
||||
exit "$status"
|
||||
}
|
||||
|
||||
trap validation_failure ERR
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
|
||||
# Package validation runs in a container with no init system. Do not let
|
||||
# maintainer scripts try to start CUPS, Avahi or other irrelevant daemons;
|
||||
# services are inspected and CUPS is started explicitly when the test needs it.
|
||||
cat > /usr/sbin/policy-rc.d <<'POLICY'
|
||||
#!/bin/sh
|
||||
exit 101
|
||||
POLICY
|
||||
chmod 0755 /usr/sbin/policy-rc.d
|
||||
|
||||
run_logged() {
|
||||
label="$1"
|
||||
seconds="$2"
|
||||
shift 2
|
||||
|
||||
if ! timeout --signal=TERM --kill-after=10s "${seconds}s" "$@" \
|
||||
>"/tmp/${label}.log" 2>&1; then
|
||||
cat "/tmp/${label}.log" >&2
|
||||
echo "${label} exceeded ${seconds}s or failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
run_logged apt-update 120 apt-get update -qq
|
||||
|
||||
previous="${1:-}"
|
||||
|
||||
if [[ -n "$previous" ]]; then
|
||||
apt-get install -y -qq "$previous" >/tmp/previous-install.log
|
||||
run_logged previous-install 360 apt-get install -y -qq "$previous"
|
||||
|
||||
cat > /etc/ekklesia-classroom/device.conf <<'CONFIG'
|
||||
# Configuration carried forward from 0.1.36
|
||||
UPDATE_URL=https://updates.riverofglorymn.org
|
||||
CHANNEL=canary
|
||||
DVD_ENABLED=true
|
||||
DVD_ENABLED=false
|
||||
UI_SCALE=1.25
|
||||
MQTT_ENABLED=true
|
||||
MQTT_HOST=broker.example.test
|
||||
@@ -56,7 +96,7 @@ CUSTOM_SETTING=preserve-me-too
|
||||
CONFIG
|
||||
fi
|
||||
|
||||
apt-get install -y -qq /packages/candidate.deb >/tmp/candidate-install.log
|
||||
run_logged candidate-install 360 apt-get install -y -qq /packages/candidate.deb
|
||||
|
||||
command -v nmtui >/dev/null
|
||||
command -v lpadmin >/dev/null
|
||||
@@ -78,22 +118,40 @@ sleep 1
|
||||
driver='foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Generic-PCL_6_PCL_XL_Printer-pxlcolor.ppd'
|
||||
lpinfo -m | grep -q "^${driver} "
|
||||
|
||||
classroom-printer-setup 192.0.2.10 >/tmp/printer-first.log
|
||||
classroom-printer-setup 192.0.2.10 >/tmp/printer-second.log
|
||||
lpstat -p Classroom_Color -d -v | grep -q 'socket://192.0.2.10:9100'
|
||||
# Simulate the queue an older release may have left behind, then run the real
|
||||
# boot provisioning path. Chrome is stubbed as already installed and DVD is
|
||||
# disabled so the test remains entirely local and deterministic.
|
||||
lpadmin -p Classroom_Color -v socket://192.0.2.10:9100 -m "$driver"
|
||||
install -m755 /bin/true /usr/local/bin/google-chrome
|
||||
|
||||
timeout --signal=TERM --kill-after=5s 45s classroom-provision \
|
||||
>/tmp/provision-first.log
|
||||
|
||||
! lpstat -p Classroom_Color >/dev/null 2>&1
|
||||
lpstat -p Elmer -d -v | grep -q 'socket://10.10.0.155:9100'
|
||||
lpstat -l -p Elmer | grep -q 'Description: Elmer'
|
||||
lpoptions -p Elmer -l | grep -Eq '^PrintoutMode/.*:.*\*Normal([[:space:]]|$)'
|
||||
lpoptions -p Elmer -l | grep -Eq '^ColorModel/.*:.*\*Color([[:space:]]|$)'
|
||||
[[ "$(lpstat -e)" == "Elmer" ]]
|
||||
[[ "$(systemctl is-enabled avahi-daemon.service 2>/dev/null || true)" == "masked" ]]
|
||||
[[ "$(systemctl is-enabled avahi-daemon.socket 2>/dev/null || true)" == "masked" ]]
|
||||
|
||||
timeout --signal=TERM --kill-after=5s 45s classroom-provision \
|
||||
>/tmp/provision-second.log
|
||||
grep -q 'Elmer is already correctly configured' /tmp/provision-second.log
|
||||
|
||||
if [[ -n "$previous" ]]; then
|
||||
grep -q '^CHANNEL=canary$' /etc/ekklesia-classroom/device.conf
|
||||
grep -q '^DVD_ENABLED=true$' /etc/ekklesia-classroom/device.conf
|
||||
grep -q '^DVD_ENABLED=false$' /etc/ekklesia-classroom/device.conf
|
||||
grep -q '^UI_SCALE=1.25$' /etc/ekklesia-classroom/device.conf
|
||||
grep -q '^MQTT_PASSWORD=preserve-me$' /etc/ekklesia-classroom/device.conf
|
||||
grep -q '^CUSTOM_SETTING=preserve-me-too$' /etc/ekklesia-classroom/device.conf
|
||||
[[ "$(grep -c '^LIVE_ENABLED=' /etc/ekklesia-classroom/device.conf)" -eq 1 ]]
|
||||
|
||||
apt-get install --reinstall -y -qq /packages/candidate.deb \
|
||||
>/tmp/candidate-reinstall.log
|
||||
run_logged candidate-reinstall 360 \
|
||||
apt-get install --reinstall -y -qq /packages/candidate.deb
|
||||
[[ "$(grep -c '^LIVE_ENABLED=' /etc/ekklesia-classroom/device.conf)" -eq 1 ]]
|
||||
fi
|
||||
|
||||
echo "Trixie package, upgrade, networking, printing and reinstall checks passed."
|
||||
echo "Trixie package, upgrade, bounded install, networking, Elmer printing and reinstall checks passed."
|
||||
CONTAINER
|
||||
|
||||
Reference in New Issue
Block a user