Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): on Linux, reveal window on did-finish-load to avoid Wayland deadlock #2217

Closedmwolson(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2217/headopened View on GitHub

Showing 3 changed files with 114 additions and 10 deletions.

x
0 of 3 viewed, 3 left
12 additions and 10 deletionsapps/desktop/src/main.tsModified
View file
@@ -75,6 +75,7 @@
} from "./updateMachine.ts";
import { isArm64HostRunningIntelBuild, resolveDesktopRuntimeInfo } from "./runtimeArch.ts";
import { resolveDesktopAppBranding } from "./appBranding.ts";
+import { bindFirstRevealTrigger, type RevealSubscription } from "./windowReveal.ts";
​
syncShellEnvironment();
​
@@ -1998,16 +1999,17 @@
emitUpdateState();
- let initialRevealScheduled = false;
- const revealInitialWindow = () => {
- if (initialRevealScheduled) {
- return;
- }
- initialRevealScheduled = true;
- revealWindow(window);
- };
-​
- window.once("ready-to-show", revealInitialWindow);
+ // On Linux/Wayland with `show: false`, Electron's `ready-to-show` only
+ // fires after `show()` is called, deadlocking the standard "wait for
+ // ready, then show" pattern. Add `did-finish-load` as a Linux-only
+ // fallback so the window still surfaces once the renderer has loaded
+ // the page. Other platforms keep the no-flash `ready-to-show` path,
+ // since `did-finish-load` typically fires before the first paint there.
+ const revealSubscribers: RevealSubscription[] = [(fire) => window.once("ready-to-show", fire)];