From e531228fa9d962e72641e4c37f2aaf96ed5c390e Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Wed, 14 Oct 2026 18:10:11 -0700 Subject: [PATCH] fix(streaming): keep Flash Player's window in place while it's open Flash Player moves its window back to the top of the screen once the movie has loaded, bringing the menu bar back. The streamer now checks the window twice a second and puts it back, logging the first few times. --- streaming/streamer/README.md | 3 ++- streaming/streamer/root/usr/local/bin/fp-launch | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/streaming/streamer/README.md b/streaming/streamer/README.md index ad1e4db..22b7f57 100644 --- a/streaming/streamer/README.md +++ b/streaming/streamer/README.md @@ -57,5 +57,6 @@ stretched to the display and moved up by its menu bar's height, which hides the menu bar. GTK draws the menu bar in the window itself and the movie in a child window below it, so the movie's offset, read with `xwininfo`, is the menu bar's height. The window is made override-redirect first, since the window manager -keeps windows on screen. Its full-screen mode isn't used, since some games, such +keeps windows on screen, and is kept in place while it's open, since Flash +Player moves it back once the movie has loaded. 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. diff --git a/streaming/streamer/root/usr/local/bin/fp-launch b/streaming/streamer/root/usr/local/bin/fp-launch index b20c873..6d556ab 100755 --- a/streaming/streamer/root/usr/local/bin/fp-launch +++ b/streaming/streamer/root/usr/local/bin/fp-launch @@ -68,9 +68,20 @@ case ${app,,} in xdotool windowunmap --sync "$wid" xdotool set_window --overrideredirect 1 "$wid" xdotool windowmap --sync "$wid" - xdotool windowsize "$wid" "$width" $((height + menu)) \ - windowmove "$wid" 0 $((-menu)) windowfocus "$wid" - xdotool getwindowgeometry "$wid" + place() { xdotool windowsize "$wid" "$width" $((height + menu)) windowmove "$wid" 0 $((-menu)); } + place + xdotool windowfocus "$wid" + # Flash Player moves its window back once the movie has loaded, so it's + # kept in place for as long as it's open + moves=0 + while geometry=$(xdotool getwindowgeometry --shell "$wid" 2>/dev/null); do + eval "$geometry" + if ((X != 0 || Y != -menu || WIDTH != width || HEIGHT != height + menu)); then + ((++moves <= 3)) && echo "Flash Player window moved to $X,$Y (${WIDTH}x${HEIGHT}); putting it back" + place + fi + sleep 0.5 + done ) & fi cd "${argv[0]}"