From 70fd42808e0017b34e2bc48a87f96218890debbd Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 21 Aug 2017 17:42:45 +0900 Subject: [PATCH] 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_)