Skip to content

Commit

Permalink
init/instance/nwjs: don't store maximized state
Browse files Browse the repository at this point in the history
See #1009
  • Loading branch information
bastimeyer committed May 16, 2024
1 parent 5ee7ac9 commit 25e7432
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/app/init/instance-initializers/nwjs/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ function onMove( windowRecord, x, y ) {
}

function onMaximize( windowRecord, maximized ) {
// HACK: the window `restore` event does not trigger on NW.js >=0.80,<0.84,
// causing the window state to become broken (see #1015):
// Don't store the maximized state for now
maximized = false;
return save( windowRecord, { maximized } );
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/tests/init/instance-initializers/nwjs/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ module( "init/instance-initializers/nwjs/window", function( hooks ) {
y: 270,
width: 960,
height: 540,
maximized: true
maximized: false // FIXME: restore this
},
"Saves maximized state on maximize"
);
Expand Down Expand Up @@ -609,7 +609,7 @@ module( "init/instance-initializers/nwjs/window", function( hooks ) {
y: 0,
width: 1920,
height: 1080,
maximized: true
maximized: false // FIXME: restore this
},
"Updates the window record only after the event ignore time expires"
);
Expand Down

0 comments on commit 25e7432

Please sign in to comment.