]> khamidou — GitHub mirrors - electron.git/commitdiff
win: Don't allow maximzing a unresiazble frameless window
authorCheng Zhao <zcbenz@gmail.com>
Mon, 15 Dec 2014 20:51:45 +0000 (12:51 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 15 Dec 2014 20:55:16 +0000 (12:55 -0800)
Fixes #857.

atom/browser/native_window_views.cc

index 8825371dc3907856e6945c7535fc73b4a22b1dc6..69ca71325cba60413ce76bd00cdebe36e874eb9c 100644 (file)
@@ -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