Skip to content

Commit 2e6ed66

Browse files
committed
fix(desktop): drop the display recovery workaround
The invisible window after a mixed-DPI wake (#59229) comes from Chromium's HWNDMessageHandler and is being fixed there. Keep only OpenCode's own fixes: restore maximized windows on their saved display, open them maximized on Windows, and decode the saved window state with Schema.
1 parent b15489a commit 2e6ed66

5 files changed

Lines changed: 57 additions & 459 deletions

File tree

‎packages/desktop/src/main/windows/display.test.ts‎

Lines changed: 0 additions & 145 deletions
This file was deleted.

‎packages/desktop/src/main/windows/display.ts‎

Lines changed: 0 additions & 197 deletions
This file was deleted.

‎packages/desktop/src/main/windows/index.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { randomUUID } from "node:crypto"
2-
import { app, BrowserWindow, powerMonitor, screen } from "electron"
2+
import { app, BrowserWindow, screen } from "electron"
33
import { Effect, FileSystem, Path } from "effect"
44
import { openExternalURL } from "../files"
55
import { scoped } from "../native/logging"
@@ -29,7 +29,6 @@ import { loadWindow } from "./scheme"
2929
import { createWindowRegistry } from "./registry"
3030
import { windowRecovery } from "./recovery"
3131
import { takeEarlyWindow, type EarlyWindow } from "./early"
32-
import { wireDisplayRecovery } from "./display"
3332
import { manageWindowState, readWindowState, resolveWindowState, windowStateFile } from "./window-state"
3433
import { allowRendererPermissions, wireNavigationPolicy, wireRendererHeaders } from "./security"
3534

@@ -178,8 +177,6 @@ export const mainWindows = Effect.fn("Window.make")(function* () {
178177

179178
if (!early) loadWindow(win, "index.html")
180179
wireZoom(win)
181-
182-
if (process.platform === "win32") wireDisplayRecovery(win, { powerMonitor, screen, updateTitlebar })
183180
let contentReady = false
184181
let appliedTheme = false
185182
let revealed = !!early
@@ -242,3 +239,5 @@ export const mainWindows = Effect.fn("Window.make")(function* () {
242239

243240
return { create, restore }
244241
})
242+
243+

0 commit comments

Comments
 (0)