()
| 74 | } |
| 75 | |
| 76 | const loadLastWindowSize = (): Rectangle => { |
| 77 | try { |
| 78 | const res = store.get(windowSizeStorageKey) as Rectangle | null |
| 79 | if (res && res.height > 50 && res.width > 50) { |
| 80 | if (isWindowVisibleOnAnyDisplay(res)) { |
| 81 | return res |
| 82 | } |
| 83 | // Position is off-screen (e.g., monitor disconnected) but size is valid. |
| 84 | // Keep user's preferred dimensions, reset position to a visible display. |
| 85 | const fallback = defaultExecutorBounds() |
| 86 | return { x: fallback.x, y: fallback.y, width: res.width, height: res.height } |
| 87 | } |
| 88 | } catch (e) { |
| 89 | // pass |
| 90 | } |
| 91 | return defaultExecutorBounds() |
| 92 | } |
| 93 | |
| 94 | const saveWindowSize = debounce( |
| 95 | (bounds: Rectangle) => { |
no test coverage detected