diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 759f57e13b..11c2436d78 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -304,11 +304,16 @@ NativeWindowViews::NativeWindowViews( ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style); #endif - // TODO(zcbenz): This was used to force using native frame on Windows 2003, we - // should check whether setting it in InitParams can work. if (has_frame()) { + // TODO(zcbenz): This was used to force using native frame on Windows 2003, + // we should check whether setting it in InitParams can work. window_->set_frame_type(views::Widget::FrameType::FRAME_TYPE_FORCE_NATIVE); window_->FrameTypeChanged(); +#if defined(OS_WIN) + // thickFrame also works for normal window. + if (!thick_frame_) + FlipWindowStyle(GetAcceleratedWidget(), false, WS_THICKFRAME); +#endif } gfx::Size size = bounds.size(); @@ -577,6 +582,12 @@ gfx::Size NativeWindowViews::GetContentSize() { void NativeWindowViews::SetContentSizeConstraints( const extensions::SizeConstraints& size_constraints) { NativeWindow::SetContentSizeConstraints(size_constraints); +#if defined(OS_WIN) + // Changing size constraints would force adding the WS_THICKFRAME style, so + // do nothing if thickFrame is false. + if (!thick_frame_) + return; +#endif // widget_delegate() is only available after Init() is called, we make use of // this to determine whether native widget has initialized. if (window_ && window_->widget_delegate()) @@ -589,7 +600,7 @@ void NativeWindowViews::SetContentSizeConstraints( void NativeWindowViews::SetResizable(bool resizable) { #if defined(OS_WIN) - if (has_frame()) + if (has_frame() && thick_frame_) FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME); #elif defined(USE_X11) if (resizable != resizable_) { diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 4f4dbc2a0c..3a1ab180e4 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1962,7 +1962,7 @@ describe('BrowserWindow module', function () { assert.equal(w.isResizable(), true) }) - xit('works for a frameless window', () => { + it('works for a frameless window', () => { w.destroy() w = new BrowserWindow({show: false, frame: false}) assert.equal(w.isResizable(), true)