From c0331673dac6f82ad2d0e282aa0df3bb5a166a9d Mon Sep 17 00:00:00 2001 From: Aleksei Kuzmin Date: Wed, 16 Aug 2017 17:18:50 +0300 Subject: [PATCH 1/3] Revert "Disable a failing test" This reverts commit 25c0cf06120466ed4104e1a5035f853135d1114b. --- spec/api-browser-window-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 19323c88f90c92936ac717f3b05aa664a6305a07 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 21 Aug 2017 17:21:59 +0900 Subject: [PATCH 2/3] win: Fix "thickFrame: false" not working for normal window --- atom/browser/native_window_views.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 759f57e13b..7ad871588a 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -304,11 +304,14 @@ 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(); + // thickFrame also works for normal window. + if (!thick_frame_) + FlipWindowStyle(GetAcceleratedWidget(), false, WS_THICKFRAME); } gfx::Size size = bounds.size(); @@ -577,9 +580,11 @@ gfx::Size NativeWindowViews::GetContentSize() { void NativeWindowViews::SetContentSizeConstraints( const extensions::SizeConstraints& size_constraints) { NativeWindow::SetContentSizeConstraints(size_constraints); + // Changing size constraints would force adding the WS_THICKFRAME style, so + // do nothing if thickFrame is false. // 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()) + if (thick_frame_ && window_ && window_->widget_delegate()) window_->OnSizeConstraintsChanged(); #if defined(USE_X11) if (resizable_) @@ -589,7 +594,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_) { From 70fd42808e0017b34e2bc48a87f96218890debbd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 21 Aug 2017 17:42:45 +0900 Subject: [PATCH 3/3] Fix build on Linux --- atom/browser/native_window_views.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 7ad871588a..11c2436d78 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -309,9 +309,11 @@ NativeWindowViews::NativeWindowViews( // 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(); @@ -580,11 +582,15 @@ 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 (thick_frame_ && window_ && window_->widget_delegate()) + if (window_ && window_->widget_delegate()) window_->OnSizeConstraintsChanged(); #if defined(USE_X11) if (resizable_)