Skip to content

fix(desktop): preserve hosted macOS window size - #4728

Merged
janicduplessis merged 1 commit into
mainfrom
codex/2945-hosted-window-size
Nov 1, 2026
Merged

janicduplessis merged 1 commit into
mainfrom
codex/2945-hosted-window-size

Conversation

@janicduplessis

Copy link
Copy Markdown
Collaborator

Description

Hosted macOS previews use encoded frame pixels as the window's point size. An owned 1600-point window actually streams at 1280 pixels, so Desktop shrinks it before the card needs to fit it.

Solution

Use the current window's logical size from the existing macos-windows metadata. Keep the pixel-based fallback when that metadata is absent, and update layout when it arrives after a frame. Frame decoding, normalized input and the server protocol are unchanged.

Fixes #2945.

Test plan

Actual owned mini hosted window confirms 1600×328 points versus 1280×263 encoded pixels; normalized input toggles its checkbox. An owned Desktop DEBUG presentation replays that captured frame through the production decoder/layout: delivering current-window metadata afterward grows the second preview to its true point size while the legacy fallback stays unchanged. Temporary fixture wiring is restored byte-exact.

Only the verified owned Desktop window was captured, using the documented fallback for agent-device#3965.

Before metadata

After metadata

@janicduplessis janicduplessis left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review of a33f433 against 28c96d1: no actionable findings.

Reviewed all seven changed files and the existing host metadata producer. The decoder uses the actual current window's logical frame, the shared window choice publishes and clears that size, and the hosted tile updates when metadata arrives after its first frame. Local macOS capture retains its existing point-size callback. Encoded frame decoding, normalized input, server protocol, iOS and Android paths are unchanged. The existing decoder case covers window selection and legacy metadata absence without adding test cases.

Personally inspected the before/after owned Desktop captures: metadata grows the second preview to the captured 1600-point width while the legacy control remains at 1280. The PR correctly distinguishes the real hosted stream/input check from the temporary DEBUG presentation through production decoder/layout, and records the exact restoration and owned-window capture limitation. Final source matches the preliminarily reviewed diff.

@janicduplessis janicduplessis added the review: ai-approved A fresh AI review found nothing left to fix label Nov 1, 2026
@janicduplessis

Copy link
Copy Markdown
Collaborator Author

Codex review at a33f433667d15cf1fd690c9e0e17e3a4f0639e62:

No actionable regressions were found in the diff or affected sizing and stream paths. Runtime validation was not performed in the read-only environment.

@janicduplessis
janicduplessis marked this pull request as ready for review November 1, 2026 10:45
@janicduplessis
janicduplessis added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 04d5a3e Nov 1, 2026
7 of 8 checks passed
@janicduplessis
janicduplessis deleted the codex/2945-hosted-window-size branch November 1, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: ai-approved A fresh AI review found nothing left to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: hosted macOS app window draws below its real size when wider than 640 pt

1 participant