Skip to content

Force proportional windowed initial size for Zed; shrink Chrome MCP viewport - #2300

Merged
lukemarsden merged 1 commit into
mainfrom
feature/001916-why-do-the-zed-windows
Apr 26, 2026
Merged

Force proportional windowed initial size for Zed; shrink Chrome MCP viewport#2300
lukemarsden merged 1 commit into
mainfrom
feature/001916-why-do-the-zed-windows

Conversation

@lukemarsden

Copy link
Copy Markdown
Collaborator

Summary

Zed has been launching maximised in every new spectask on the Ubuntu/GNOME desktop, and unmaximising it leaves a window taller than the streamed viewport. Root cause: upstream Zed commit a0d0195ca9 ("Add onboarding for parallel agents", 2026-04-07) bumped DEFAULT_WINDOW_SIZE from 1536×864 to 1536×1095. That commit landed in the Helix Zed fork via the 001864 merge on 2026-04-24. On a 1920×1080 virtual monitor default_bounds() clips the new value to 1536×1080 — exactly the work-area height — which trips Mutter's auto-maximize=true and the user sees a fullscreen Zed.

Coincidentally, the chrome-devtools MCP --viewport 1600x1080 set in task 001532 produced a ~1600×1160 Chrome window that also tripped the same auto-maximise threshold; shrinking it is a one-line follow-on that gets Chrome out of the same trap.

Changes

  • desktop/ubuntu-config/start-zed-helix.sh: export ZED_WINDOW_SIZE and ZED_WINDOW_POSITION computed dynamically as 80% of GAMESCOPE_WIDTH/HEIGHT divided by GDK_SCALE, with a 10% margin on each side. Zed wraps env-var bounds as WindowBounds::Windowed, which skips the auto-maximise path entirely. Formula lands on 1536×864 at 1920×1080/100% — exactly the dimensions Zed defaulted to before a0d0195ca9 — and scales proportionally to 4K (3072×1728), 5K (2048×1152 at 200% zoom), etc.
  • api/pkg/external-agent/zed_config.go: shrink the chrome-devtools MCP viewport from 1600x1080 to 1280x800. 1280 is the canonical desktop-vs-mobile breakpoint, so sites still render in desktop mode, and the resulting Chrome window leaves a wide margin on a 1920×1080 monitor.

The Sway desktop is untouched — its tiling behaviour is a different dynamic and out of scope for this task.

Test plan

  • Fresh spectask at default 1920×1080 / 100% zoom: Zed launches centred 1536×864 at origin (192, 108), not maximised
  • Spectask with GAMESCOPE_WIDTH=3840 GAMESCOPE_HEIGHT=2160: Zed scales to ~3072×1728 centred
  • Spectask with HELIX_ZOOM_LEVEL=200: Zed at the scaled logical size
  • Chrome opened via chrome-devtools MCP: window ~1280×880, desktop sites render in desktop mode
  • Stream in a small browser viewport (≈1280×720) on a 1920×1080 session: Zed not clipped at the bottom
  • Sway sessions: no behaviour change

Spec: helix-specs:001916_why-do-the-zed-windows


🔗 Open in Helix

📋 Spec:

🚀 Built with Helix

…iewport

Upstream Zed commit a0d0195ca9 ("Add onboarding for parallel agents",
PR #52940, 2026-04-07) bumped DEFAULT_WINDOW_SIZE from 1536x864 to
1536x1095. That commit landed in the Helix Zed fork via the 001864 merge
on 2026-04-24, and CI built the new binary the same day.

On a 1920x1080 virtual monitor, default_bounds() clips the new value to
1536x1080 — exactly the work-area height — which trips Mutter's
auto-maximize=true and the user sees a fullscreen Zed instead of the
centered floating window they used to see.

Fix part 1: set ZED_WINDOW_SIZE / ZED_WINDOW_POSITION env vars in the
Ubuntu Zed launcher, sized to 80% of the logical work area (logical =
GAMESCOPE_WIDTH/HEIGHT divided by GDK_SCALE) with a 10% margin on each
side. Zed wraps env-var bounds as WindowBounds::Windowed so the
auto-maximize path is skipped entirely. The formula lands on 1536x864 at
1920x1080/100% — the exact size Zed defaulted to before a0d0195ca9 — and
scales proportionally to 4K, 5K, and HiDPI sessions.

Fix part 2: shrink the chrome-devtools MCP viewport from 1600x1080 to
1280x800. The 1600x1080 chosen in task 001532 produced a ~1600x1160
Chrome window (page + decorations) that also tripped Mutter's
auto-maximize. 1280 is the canonical desktop-vs-mobile breakpoint, so
sites still render in desktop mode, and the resulting window fits
comfortably on every supported display.

Sway desktop is unaffected — its tiling behaviour is a separate dynamic
and the Sway launcher is not changed.

Spec-Ref: helix-specs:001916_why-do-the-zed-windows
@lukemarsden
lukemarsden merged commit eb864c5 into main Apr 26, 2026
1 check passed
@lukemarsden
lukemarsden deleted the feature/001916-why-do-the-zed-windows branch April 26, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant