Compare commits

...
Author SHA1 Message Date
branderson 35d08df8d3 fix(streaming): measure Flash Player's menu bar and move it past the window manager
The window manager kept the projector's window on screen and no taller
than the display, so its opening size didn't include the menu bar, the
menu bar was measured as zero and stayed visible, and the movie was
squeezed into what was left. The menu bar's height is now read from its
own X window, with xwininfo, and the window is made override-redirect
before it's moved and resized, then given focus directly. The measured
height and the window's children are logged.
2026-10-14 17:31:24 -07:00
3 changed files with 21 additions and 12 deletions
+1
View File
@@ -30,6 +30,7 @@ RUN apt-get update && \
libxtst6 \
libxxf86vm1 \
sqlite3 \
x11-utils \
xdotool && \
rm -rf /var/lib/apt/lists/*
+6 -4
View File
@@ -53,7 +53,9 @@ Director projector's `Prefs`, where it saves, is linked into `/config/saves`, as
is Flash Player's save directory, so the session manager syncs both to the
player's browser. OldCPUSimulator hangs under Wine, so its target runs under
`cpulimit` at the same share of the CPU. A Flash projector's window is
stretched to the display and moved up by its menu bar's height, which hides the
menu bar; the height is the window's opening height less the movie's
(`GAME_HEIGHT`). Its full-screen mode isn't used, since some games, such as
Bloons, don't play right in it. Flashpoint Navigator's toolbars are hidden.
stretched to the display and moved up by its menu bar's height, measured from
the menu bar's own X window, which hides the menu bar. The window is made
override-redirect first, since the window manager would otherwise keep it on
screen and no taller than the display. Its full-screen mode isn't used, since
some games, such as Bloons, don't play right in it. Flashpoint Navigator's
toolbars are hidden.
@@ -49,16 +49,22 @@ case ${app,,} in
if [[ ${app,,} == 'fpsoftware\flash\'* ]]; then
# Hide the projector's menu bar by moving it above the display, and fill
# the display with the movie. Not full screen, which some games, such as
# Bloons, don't play right in. The window opens at the movie's size plus
# the menu bar, which gives the menu bar's height.
# Bloons, don't play right in. The window manager keeps windows on screen
# and no taller than it, so the window is taken out of its hands first.
(
wid=$(xdotool search --sync --onlyvisible --name 'Flash Player' | head -1)
eval "$(xdotool getwindowgeometry --shell "$wid")"
read -r display_width display_height < <(xdotool getdisplaygeometry)
menu=$((HEIGHT - ${GAME_HEIGHT:-$display_height}))
((menu > 0 && menu < 100)) || menu=0
xdotool windowsize "$wid" "$display_width" $((display_height + menu)) \
windowmove "$wid" 0 $((-menu)) windowactivate "$wid"
read -r width height < <(xdotool getdisplaygeometry)
# The menu bar is the window's own child window at its top left
children=$(xwininfo -children -id "$wid")
menu=$(grep -oE '[0-9]+x[0-9]+\+0\+0 ' <<<"$children" |
sed -E 's/^[0-9]+x([0-9]+).*/\1/' | awk '$1 < 100' | sort -n | head -1)
echo "Flash Player window $wid: menu bar ${menu:-not found}, display ${width}x${height}"
echo "$children"
xdotool windowunmap --sync "$wid"
xdotool set_window --overrideredirect 1 "$wid"
xdotool windowmap --sync "$wid"
xdotool windowsize "$wid" "$width" $((height + ${menu:-0})) \
windowmove "$wid" 0 $((-${menu:-0})) windowfocus "$wid"
) &
fi
cd "${argv[0]}"