Skip to content

Commit 2dd7995

Browse files
committedMar 2, 2025
Update main.js
1 parent bf9f6d4 commit 2dd7995

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎main/main.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,12 @@ function createWindowWithBounds (bounds, customArgs) {
232232
mainView.setBounds({x: 0, y: 0, width: bounds.width, height: bounds.height})
233233
newWin.contentView.addChildView(mainView)
234234

235-
newWin.on('resize', function() {
236-
const winBounds = newWin.getContentBounds()
237-
mainView.setBounds({x: 0, y: 0, width: winBounds.width, height: winBounds.height})
235+
newWin.on('resize', function () {
236+
// The result of getContentBounds doesn't update until the next tick
237+
setTimeout(function () {
238+
const winBounds = newWin.getContentBounds()
239+
mainView.setBounds({x: 0, y: 0, width: winBounds.width, height: winBounds.height})
240+
}, 0)
238241
})
239242

240243
if (bounds.maximized) {

0 commit comments

Comments
 (0)
Please sign in to comment.