Streaming: measure Flash Player's menu bar from the movie's offset #11

Merged
branderson merged 2 commits from flash-menu-offset into main 2026-10-14 18:18:02 -07:00
Collaborator

Summary generated by LLM agent

Replaces #10. With #9 on flashbox, Flash Player's menu bar still shows, the game is cut off at the bottom, and darts now fly. #10's fix never ran: its menu-bar lookup found nothing, and under fp-launch's set -e and pipefail that silently ended the block that moves the window.

What the window looks like

Read with xwininfo on flashbox, with Bloons streaming at 640x480:

Window 0x1000003 "Adobe Flash Player 32,0,0,465": 640x536, parent: the window manager's frame
  0x100001e: 640x480+0+56   <- the movie
  0x1000004: 1x1+-1+-1
  • The menu bar isn't its own window. GTK draws it in the main window, so #10's lookup for a menu bar child found nothing. The movie is the largest child window, and its offset (56px) is the menu bar's height.
  • The window manager refused the move above the screen. The window wasn't resized (it's 536 tall, 480 plus 56). But the window manager's frame wouldn't move above the screen, so under #9 the menu bar stayed at the top and the bottom 56px of the game fell off the display.

Changes

  • Measuring. The menu bar's height is the vertical offset of the window's largest child window. On the output above it gives 56 under both mawk and gawk.
  • Bypassing the window manager. As in #10, the window is made override-redirect (unmap, set, map), resized to the display plus the menu bar, moved up by the menu bar's height, and given keyboard focus directly.
  • Keeping it there. Testing on flashbox showed the window at 0,-56 right after the move, then back at 0,0 once the game had loaded: Flash Player repositions its own window. So after placing it, the streamer checks the window's geometry twice a second for as long as the window exists, puts it back when it differs, and logs the first three corrections.
  • No silent exits. The block turns off errexit and pipefail, and logs the measured height, the display size and the window's final geometry to /config/fp-launch.log.
  • Image and env. x11-utils is added for xwininfo, as in #10. GAME_WIDTH/GAME_HEIGHT, which only fed the old measurement, are dropped, while the session manager still rounds just the display to even sizes.

Testing

  • Session manager tests pass (21), and fp-launch passes bash -n.
  • The measurement was checked against flashbox's real xwininfo output.
  • The placement loop was simulated with fake xdotool/xwininfo under set -euo pipefail. It restored the window after a simulated move back to 0,0, logged it once, and ended when the window closed.
  • Moving the window needs a real stream. With Bloons on flashbox, check:
    1. no menu bar;
    2. the full game height is visible;
    3. darts still fly;
    4. the log shows Flash Player window …: menu bar 56px, and then probably one moved to 0,0 …; putting it back once the game loads.
**Summary generated by LLM agent** Replaces #10. With #9 on flashbox, Flash Player's menu bar still shows, the game is cut off at the bottom, and darts now fly. #10's fix never ran: its menu-bar lookup found nothing, and under `fp-launch`'s `set -e` and `pipefail` that silently ended the block that moves the window. ## What the window looks like Read with `xwininfo` on flashbox, with Bloons streaming at 640x480: ``` Window 0x1000003 "Adobe Flash Player 32,0,0,465": 640x536, parent: the window manager's frame 0x100001e: 640x480+0+56 <- the movie 0x1000004: 1x1+-1+-1 ``` - **The menu bar isn't its own window.** GTK draws it in the main window, so #10's lookup for a menu bar child found nothing. The movie is the largest child window, and its offset (56px) is the menu bar's height. - **The window manager refused the move above the screen.** The window wasn't resized (it's 536 tall, 480 plus 56). But the window manager's frame wouldn't move above the screen, so under #9 the menu bar stayed at the top and the bottom 56px of the game fell off the display. ## Changes - **Measuring.** The menu bar's height is the vertical offset of the window's largest child window. On the output above it gives 56 under both mawk and gawk. - **Bypassing the window manager.** As in #10, the window is made override-redirect (unmap, set, map), resized to the display plus the menu bar, moved up by the menu bar's height, and given keyboard focus directly. - **Keeping it there.** Testing on flashbox showed the window at `0,-56` right after the move, then back at `0,0` once the game had loaded: Flash Player repositions its own window. So after placing it, the streamer checks the window's geometry twice a second for as long as the window exists, puts it back when it differs, and logs the first three corrections. - **No silent exits.** The block turns off `errexit` and `pipefail`, and logs the measured height, the display size and the window's final geometry to `/config/fp-launch.log`. - **Image and env.** `x11-utils` is added for `xwininfo`, as in #10. `GAME_WIDTH`/`GAME_HEIGHT`, which only fed the old measurement, are dropped, while the session manager still rounds just the display to even sizes. ## Testing - Session manager tests pass (21), and `fp-launch` passes `bash -n`. - The measurement was checked against flashbox's real `xwininfo` output. - The placement loop was simulated with fake `xdotool`/`xwininfo` under `set -euo pipefail`. It restored the window after a simulated move back to `0,0`, logged it once, and ended when the window closed. - Moving the window needs a real stream. With Bloons on flashbox, check: 1. no menu bar; 2. the full game height is visible; 3. darts still fly; 4. the log shows `Flash Player window …: menu bar 56px`, and then probably one `moved to 0,0 …; putting it back` once the game loads.
dejima-agent added 1 commit 2026-10-14 18:03:34 -07:00
GTK draws the projector's menu bar in its window, not in a child window,
so the previous lookup found nothing and, under set -e and pipefail,
silently ended the block that moves the window. The movie is the
window's largest child, and its offset is the menu bar's height (56px
on flashbox). The block no longer stops on errors, logs what it measured
and where the window ended up, and GAME_WIDTH/GAME_HEIGHT, unused now,
are dropped.
dejima-agent added 1 commit 2026-10-14 18:09:41 -07:00
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.
branderson approved these changes 2026-10-14 18:17:58 -07:00
branderson merged commit 9a9d7e3787 into main 2026-10-14 18:18:02 -07:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: branderson/dotcom-arcade#11