diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 9d4f9110fff5..9664d1754404 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -591,6 +591,7 @@ void NativeWindowViews::SetResizable(bool resizable) { // both the minimum and maximum size to the window size to achieve it. if (resizable) { SetContentSizeConstraints(old_size_constraints_); + SetMaximizable(maximizable_); } else { old_size_constraints_ = GetContentSizeConstraints(); resizable_ = false; @@ -603,7 +604,6 @@ void NativeWindowViews::SetResizable(bool resizable) { if (has_frame() && thick_frame_) FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME); #endif - resizable_ = resizable; } diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index ceb6e50da91e..7d13b923309f 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -2620,9 +2620,15 @@ describe('BrowserWindow module', () => { // Only implemented on windows. if (process.platform !== 'win32') return - it('is set to false when resizable state is set to false', () => { + it('is reset to its former state', () => { + w.setMaximizable(false) w.setResizable(false) + w.setResizable(true) assert.strictEqual(w.isMaximizable(), false) + w.setMaximizable(true) + w.setResizable(false) + w.setResizable(true) + assert.strictEqual(w.isMaximizable(), true) }) })