Skip to content

Hide Linux titlebar menu chrome#439

Draft
moteea wants to merge 1 commit into
ilysenko:mainfrom
moteea:codex/hide-linux-titlebar-menu
Draft

Hide Linux titlebar menu chrome#439
moteea wants to merge 1 commit into
ilysenko:mainfrom
moteea:codex/hide-linux-titlebar-menu

Conversation

@moteea

@moteea moteea commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • hide the Linux primary-window titlebar overlay by keeping Electron's titleBarOverlay object but making it transparent and 1px tall
  • strengthen Linux menu suppression by calling both setMenuBarVisibility(false) and removeMenu?.() next to the existing Windows removeMenu() path
  • map Linux webview window chrome back to native instead of application-menu, so the renderer no longer reserves application-menu/window-control chrome space

Why

Recent Codex Desktop builds can show a Linux app/menu decoration row or a visible top-right Electron titlebar overlay. Removing the overlay object entirely, or switching the window to frame: false, can crash the Linux build. Keeping the overlay API present while making it visually transparent avoids that crash path while removing the unwanted chrome.

Validation

  • node --check scripts/patches/main-process.js
  • node --check scripts/patches/webview-assets.js
  • node --test scripts/patch-linux-window-ui.test.js
  • tests/scripts_smoke.sh

This behavior was also verified manually through a Nix/Home Manager override against Codex Desktop 26.602.71036 on Linux.

@ilysenko ilysenko left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Current upstream build applies correctly for me: the generated bundle has the transparent 1px Linux titleBarOverlay, Linux removeMenu?.(), and the webview chrome mapping changes Linux back to native.

One thing to tighten before this leaves draft: applyLinuxWindowControlsSafeAreaPatch now has currentInset equal to the default inset because the right safe area is 0. That makes the inset branch a no-op, and the final currentInset check can make future upstream drift look already-applied if upstream keeps applicationMenu:Object.freeze({left:0,right:0}) but changes/removes the chrome-mapping snippets. Since this PR's functional fix depends on those mapping snippets, please track whether the Linux chrome mapping or browser gate was actually found/already in the desired form, and warn if the safe-area bundle is present but neither mapping is recognizable. That keeps future upstream drift visible instead of silently shipping the old Linux application-menu layout.

@moteea moteea force-pushed the codex/hide-linux-titlebar-menu branch from 11e029f to 5a3a59c Compare June 10, 2026 16:58
@moteea moteea force-pushed the codex/hide-linux-titlebar-menu branch from 5a3a59c to 5d23bfc Compare June 10, 2026 17:04
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.

2 participants