Skip to content

Commit d7b7b29

Browse files
authored
Adjust window dimensions based on the resizable property. (#215)
Updated the logic to set window width and height to ignore stored window state when `resizable` is false. This ensures consistent behavior for fixed-size windows regardless of previous state data.
1 parent d9a7eea commit d7b7b29

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

resources/js/electron-plugin/dist/server/api/window.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ router.post('/open', (req, res) => {
163163
defaultWidth: parseInt(width),
164164
});
165165
}
166-
const window = new BrowserWindow(Object.assign(Object.assign({ width: (windowState === null || windowState === void 0 ? void 0 : windowState.width) || parseInt(width), height: (windowState === null || windowState === void 0 ? void 0 : windowState.height) || parseInt(height), frame: frame !== undefined ? frame : true, x: (windowState === null || windowState === void 0 ? void 0 : windowState.x) || x, y: (windowState === null || windowState === void 0 ? void 0 : windowState.y) || y, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, show: false, title,
166+
const window = new BrowserWindow(Object.assign(Object.assign({ width: resizable
167+
? (windowState === null || windowState === void 0 ? void 0 : windowState.width) || parseInt(width)
168+
: parseInt(width), height: resizable
169+
? (windowState === null || windowState === void 0 ? void 0 : windowState.height) || parseInt(height)
170+
: parseInt(height), frame: frame !== undefined ? frame : true, x: (windowState === null || windowState === void 0 ? void 0 : windowState.x) || x, y: (windowState === null || windowState === void 0 ? void 0 : windowState.y) || y, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, show: false, title,
167171
backgroundColor, transparent: transparency, alwaysOnTop,
168172
resizable,
169173
movable,

resources/js/electron-plugin/src/server/api/window.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,12 @@ router.post('/open', (req, res) => {
255255
}
256256

257257
const window = new BrowserWindow({
258-
width: windowState?.width || parseInt(width),
259-
height: windowState?.height || parseInt(height),
258+
width: resizable
259+
? windowState?.width || parseInt(width)
260+
: parseInt(width),
261+
height: resizable
262+
? windowState?.height || parseInt(height)
263+
: parseInt(height),
260264
frame: frame !== undefined ? frame : true,
261265
x: windowState?.x || x,
262266
y: windowState?.y || y,

0 commit comments

Comments
 (0)