From 3d30e6ddc4439327ca02158471258a6274d2436e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 15 Dec 2014 12:51:45 -0800 Subject: [PATCH] win: Don't allow maximzing a unresiazble frameless window Fixes #857. --- atom/browser/native_window_views.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 8825371dc390..69ca71325cba 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -411,17 +411,15 @@ gfx::Size NativeWindowViews::GetMaximumSize() { void NativeWindowViews::SetResizable(bool resizable) { #if defined(OS_WIN) - if (has_frame_) { - // WS_MAXIMIZEBOX => Maximize button - // WS_MINIMIZEBOX => Minimize button - // WS_THICKFRAME => Resize handle - DWORD style = ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE); - if (resizable) - style |= WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME; - else - style = (style & ~(WS_MAXIMIZEBOX | WS_THICKFRAME)) | WS_MINIMIZEBOX; - ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, style); - } + // WS_MAXIMIZEBOX => Maximize button + // WS_MINIMIZEBOX => Minimize button + // WS_THICKFRAME => Resize handle + DWORD style = ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE); + if (resizable) + style |= WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME; + else + style = (style & ~(WS_MAXIMIZEBOX | WS_THICKFRAME)) | WS_MINIMIZEBOX; + ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, style); #elif defined(USE_X11) if (resizable != resizable_) { // On Linux there is no "resizable" property of a window, we have to set