Streaming: measure Flash Player's menu bar and move it past the window manager #10

Closed
dejima-agent wants to merge 1 commits from flash-menu-bar into main
Collaborator

Summary generated by LLM agent

Follow-up to #9, which left the menu bar showing and squeezed the movie. Seen on flashbox with Bloons: the menu bar was visible at the top, the game didn't fit vertically, and there were black bars at the sides.

Cause

The window manager keeps windows on screen and no taller than the display. Flash Player's window opens at the movie plus the menu bar, which is taller than the display, so it was shrunk before fp-launch read its size:

  • the menu bar measured as 0, so nothing moved;
  • the movie was scaled into the display height minus the menu bar, which caused the side bars.

Changes

  • Measuring the menu bar. Its height is read from its own X window: GTK gives the menu bar a child window at the top left of the projector's window, and xwininfo (newly added x11-utils) lists it. This doesn't depend on the window's size.
  • Bypassing the window manager. The window is unmapped, made override-redirect and mapped again, so the window manager no longer constrains it. It's then resized to the display plus the menu bar, moved up by the menu bar's height, and given keyboard focus directly, since no window manager will do that for it.
  • Logging. /config/fp-launch.log records the measured height and the window's child windows, so another miss can be diagnosed from one log.

Testing

fp-launch passes bash -n. This depends on X and GTK behavior I can't run here, so it needs checking on flashbox with Bloons:

  1. No menu bar shows.
  2. The game fills the stream.
  3. Darts fly.
  4. The keyboard still works in a game that uses it.

If anything's off, the log lines starting Flash Player window will show what was measured.

**Summary generated by LLM agent** Follow-up to #9, which left the menu bar showing and squeezed the movie. Seen on flashbox with Bloons: the menu bar was visible at the top, the game didn't fit vertically, and there were black bars at the sides. ## Cause The window manager keeps windows on screen and no taller than the display. Flash Player's window opens at the movie plus the menu bar, which is taller than the display, so it was shrunk before `fp-launch` read its size: - the menu bar measured as 0, so nothing moved; - the movie was scaled into the display height minus the menu bar, which caused the side bars. ## Changes - **Measuring the menu bar.** Its height is read from its own X window: GTK gives the menu bar a child window at the top left of the projector's window, and `xwininfo` (newly added `x11-utils`) lists it. This doesn't depend on the window's size. - **Bypassing the window manager.** The window is unmapped, made override-redirect and mapped again, so the window manager no longer constrains it. It's then resized to the display plus the menu bar, moved up by the menu bar's height, and given keyboard focus directly, since no window manager will do that for it. - **Logging.** `/config/fp-launch.log` records the measured height and the window's child windows, so another miss can be diagnosed from one log. ## Testing `fp-launch` passes `bash -n`. This depends on X and GTK behavior I can't run here, so it needs checking on flashbox with Bloons: 1. No menu bar shows. 2. The game fills the stream. 3. Darts fly. 4. The keyboard still works in a game that uses it. If anything's off, the log lines starting `Flash Player window` will show what was measured.
dejima-agent added 1 commit 2026-10-14 17:30:54 -07:00
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.
branderson closed this pull request 2026-10-14 18:18:22 -07:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: branderson/dotcom-arcade#10