Compare commits

...

2 Commits

Author SHA1 Message Date
7e667a1708 Merge branch 'main' of http://synbox.ruv.wtf:8418/litruv/cinny-desktop
Some checks failed
Build / increment-version (push) Successful in 7s
Build / build-linux (push) Successful in 2m0s
Build Paarrot Windows / start-vm (push) Failing after 5m33s
Build Paarrot Windows / build (push) Has been skipped
Build / build-windows (push) Successful in 5m59s
Build / create-release (push) Successful in 18s
2026-04-03 20:47:20 +11:00
42a01c357f feat: enhance window state restoration with screen bounds validation 2026-04-03 20:47:17 +11:00
2 changed files with 22 additions and 8 deletions

2
cinny

Submodule cinny updated: 0ddf05746a...fe193bb062

View File

@@ -333,13 +333,27 @@ function getIconPath(iconName) {
function createWindow() {
// Restore window state or use defaults
const windowState = store.get('windowState', {
width: 1280,
height: 905,
x: undefined,
y: undefined,
isMaximized: false
});
const savedState = store.get('windowState', {});
// Validate saved position is within visible screen bounds
const { screen } = require('electron');
let validPosition = false;
if (savedState.x !== undefined && savedState.y !== undefined) {
const displays = screen.getAllDisplays();
validPosition = displays.some((display) => {
const { x, y, width, height } = display.workArea;
return savedState.x >= x && savedState.x < x + width &&
savedState.y >= y && savedState.y < y + height;
});
}
const windowState = {
width: savedState.width ?? 1280,
height: savedState.height ?? 905,
x: validPosition ? savedState.x : undefined,
y: validPosition ? savedState.y : undefined,
isMaximized: savedState.isMaximized ?? false,
};
mainWindow = new BrowserWindow({
width: windowState.width,