On the laptop the browser jumped behind the disc player the moment it was
opened. 0.2.4 caused that, and the cause is two lines of the stock applet:
main.qml:153 hideActivatedLaunchers: tasks.iconsOnly || ...
main.qml:155 launchInPlace: tasks.iconsOnly && sortingStrategy === 1
For an icons-only bar the first is always true — a launcher is hidden the
instant its application starts — and the second is what puts the running
window back where the launcher was. It only does that at sortingStrategy
1. 0.2.4 set it to 0 to stop teachers dragging the icons about, so the
launcher vanished and the window was appended after the others.
Reproduced in the lab with a real Chrome window before changing anything,
and the bar read off the screen: Wonder Ink, the player, then the
browser. With 1 it is Wonder Ink, the browser, the player, through
opening, a second window, another application opening beside it, and
every close.
The launcher identity was suspected and cleared: only one browser button
appears, because google-chrome.desktop already carries Chrome's own file
name and StartupWMClass for exactly this reason.
THE COST, AND IT IS REAL. Manual sorting is also the only mode in which
MouseHandler.qml accepts a reordering drop, so a teacher who knows to drag
can rearrange the bar again. There is no value that gives both and no
Kiosk key that separates them. classroom-desktop-reset already rebuilds
the bar from the package at every login, so a drag never outlives the
session. docs/testing.md states the trade rather than burying it, and the
configuration escape is written down there too as still open.
tools/lab/order-check is the test this needed and did not have. 0.2.4
passed a full set of configuration assertions while the bar did something
else, so this one opens real application windows and reads the panel
strip as pixels — there is no image library in the lab, so it captures
PPM and names each icon by colour. Six checks, all of them behaviour.
Co-Authored-By: Claude Opus 5 <[email protected]>
83 lines
2.7 KiB
Bash
Executable File
83 lines
2.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# The launcher order, read off the screen, with real windows opening and
|
|
# closing underneath it.
|
|
#
|
|
# 0.2.4 shipped a launcher order that was right in every configuration
|
|
# test and wrong on the bar, so this test opens actual applications and
|
|
# looks at actual pixels. Run with a classroom session already up:
|
|
#
|
|
# tools/lab/lab session
|
|
# tools/lab/order-check
|
|
set -uo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
NAME="${LAB_NAME:-classroom-v2-lab}"
|
|
WANT="wonderink browser player"
|
|
|
|
passed=0
|
|
failed=0
|
|
|
|
# Consecutive repeats are collapsed before comparing. The classroom sets
|
|
# groupingStrategy=0 on purpose — every window gets its own button, so a
|
|
# teacher never has to open a group to discover a second window exists —
|
|
# so two browser windows are two browser buttons and that is correct. What
|
|
# must not change is the order of the KINDS: Wonder Ink, then the browser,
|
|
# then the player.
|
|
check() {
|
|
local label="$1"
|
|
local got
|
|
got="$("$ROOT/tools/lab/panel-order" | uniq | tr '\n' ' ' | sed 's/ *$//')"
|
|
|
|
if [[ "$got" == "$WANT" ]]; then
|
|
echo " ok $label"
|
|
passed=$((passed + 1))
|
|
else
|
|
echo " FAIL $label"
|
|
echo " wanted [$WANT]"
|
|
echo " got [$got]"
|
|
failed=$((failed + 1))
|
|
fi
|
|
}
|
|
|
|
app() {
|
|
docker exec -d -u classroom \
|
|
-e XDG_RUNTIME_DIR=/run/user/1000 -e WAYLAND_DISPLAY=wayland-0 \
|
|
-e HOME=/home/classroom -e XDG_CURRENT_DESKTOP=KDE \
|
|
-e DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \
|
|
"$NAME" sh -c "$1"
|
|
}
|
|
|
|
echo "1. nothing running"
|
|
docker exec "$NAME" pkill -u classroom chrome >/dev/null 2>&1 || true
|
|
sleep 4
|
|
check "the bar is Wonder Ink, the browser, the player"
|
|
|
|
echo "2. the browser opens"
|
|
app 'exec google-chrome --ozone-platform=wayland --no-sandbox --disable-gpu --no-first-run about:blank'
|
|
sleep 16
|
|
check "the browser stays in its place and does not move behind the player"
|
|
|
|
echo "3. a second browser window"
|
|
app 'exec google-chrome --ozone-platform=wayland --no-sandbox --disable-gpu --new-window about:blank'
|
|
sleep 12
|
|
check "a second window adds a button beside it and moves nothing"
|
|
|
|
echo "4. Wonder Ink opens as well, with the browser still running"
|
|
app 'exec classroom-wonderink'
|
|
sleep 18
|
|
check "the first launcher does not move when it is the one that opens"
|
|
|
|
echo "5. Wonder Ink closes, the browser stays"
|
|
docker exec "$NAME" pkill -u classroom -f classroom-wonderink >/dev/null 2>&1 || true
|
|
sleep 6
|
|
check "closing the middle of three changes nothing"
|
|
|
|
echo "6. the browser closes again"
|
|
docker exec "$NAME" pkill -u classroom chrome >/dev/null 2>&1 || true
|
|
sleep 6
|
|
check "closing it puts nothing back in a different order"
|
|
|
|
echo
|
|
echo "$passed passed, $failed failed"
|
|
[[ $failed -eq 0 ]]
|