fix(desktop): use native frame when X11 client insets are unsupported - #10157
fix(desktop): use native frame when X11 client insets are unsupported#10157chivopic wants to merge 11 commits into
Conversation
b4d3db0 to
4931886
Compare
898fee4 to
7cae4eb
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes production desktop window creation and default title-bar behavior on some Linux/X11 environments, adding an Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
|
Fix needed before merge: the native-frame fallback is incompatible with the existing appearance-update path. I reproduced this using Electron 43.4.1 on Linux, the exact resolver at e0328495, and the extracted production appearance helpers from current main aea9ecbc. The DesktopWindow and DesktopLifecycle files are identical between those revisions.
Please preserve each window's resolved overlay capability through appearance updates. Native-framed windows should still receive the background update; overlay-enabled windows must keep their light/dark overlay update. Cover both in a mixed-window pass instead of swallowing the exception or disabling all Linux overlay updates. Scope of the proof: real BrowserWindow and real native setters, exact source helpers, synthetic Reviewed by GPT 6 Astra via Codex in T3 Code. |
3bd26d3 to
f9ecc5a
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
| }, | ||
| } satisfies typeof ElectronWindowCreateOptions.Type; | ||
| create: (options) => | ||
| Effect.promise(() => |
There was a problem hiding this comment.
🟡 Medium electron/ElectronWindow.ts:181
Concurrent activations can create duplicate main windows on X11: create awaits resolveLinuxX11WindowFrameOptions before constructing BrowserWindow, while mainWindowRef remains empty, so ensureMain/createMainIfBackendReady both pass their checks and later overwrite the ref with different windows. Add an in-flight creation guard or serialize main-window creation so only one activation can proceed.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/desktop/src/electron/ElectronWindow.ts around line 181:
Concurrent activations can create duplicate main windows on X11: `create` awaits `resolveLinuxX11WindowFrameOptions` before constructing `BrowserWindow`, while `mainWindowRef` remains empty, so `ensureMain`/`createMainIfBackendReady` both pass their checks and later overwrite the ref with different windows. Add an in-flight creation guard or serialize main-window creation so only one activation can proceed.
There was a problem hiding this comment.
Fixed in 7b64f4b. Main-window check/create/publish paths are now serialized in DesktopWindow with a single Semaphore(1). createMain, ensureMain, and createMainIfBackendReady share that mutex and use an internal unlocked creation helper while holding it, so concurrent activation/readiness paths cannot both observe an empty main and create separate windows. Generic ElectronWindow.create (including the WSL splash path) remains unlocked.
There was a problem hiding this comment.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
f97c7a9 to
cc0132c
Compare
|
Fixed the appearance-update regression in The resolved window chrome capability is now recorded when I also added a mixed-window regression test covering a native-framed window and an overlay-enabled window in the same appearance pass: both receive the background update, while only the overlay-enabled window receives the title-bar overlay update. The branch is mergeable. The new upstream workflows are currently |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
54ebc69 to
7b64f4b
Compare
Fixes #10142.
What changed
--ozone-platform=x11|waylandoverrides._NET_SUPPORTEDhints at window creation time viaxprop._GTK_FRAME_EXTENTSis definitively unsupported, remove Electron's hidden title-bar overlay and create the window withframe: trueso the window manager supplies native decorations._GTK_FRAME_EXTENTSunchanged.Why
Electron 43 introduced Linux client-side decoration behavior that can leave an opaque resize/shadow inset on non-compositing X11 WMs such as i3. Chromium's X11 path uses WM support for
_GTK_FRAME_EXTENTSas part of deciding whether client frame insets are supported, so this patch uses the same capability boundary for T3 Code's automatic fallback.This is intentionally narrower than the closed native-frame preference PR #5398: there is no new setting, IPC state, restart preference, or UI. The fallback only activates when the current Electron backend is X11 and the WM is positively known not to support the client inset protocol implicated in the regression.
Tests
Added focused regression coverage for:
DISPLAY_GTK_FRAME_EXTENTSis absentValidation status
The branch is rebased onto current upstream
mainand is mergeable. Upstream GitHub Actions currently require approval for this fork PR: CI/preview workflows end inaction_requiredbefore creating any jobs, so there is not yet a runner result to report.Note
Use native frame when Linux X11 window manager lacks GTK frame-extents support
isLinuxX11Session) and anxprop-backed hint reader with a 250 ms timeout to inspect whether the window manager advertises the exactGTK_FRAME_EXTENTSatom.resolveLinuxX11WindowFrameOptionsconverts hidden-title-bar overlay requests to native-frame options beforeBrowserWindowconstruction; Wayland, non-X11, and inspection-failure cases keep the original options.ElectronWindow.createis now async and records each created window's title-bar-overlay capability in a weak map;syncWindowAppearancegatessetTitleBarOverlaycalls on that recorded capability.createMain,ensureMain, andcreateMainIfBackendReady, preventing concurrent publication of multiple main windows.ElectronWindow.createnow returns aPromise; callers awaiting it will see a possible 250 ms delay on Linux X11 whilexpropruns. Windows whose WM lacksGTK_FRAME_EXTENTSwill appear with native decorations instead of a hidden title bar.Macroscope summarized c029bb0.