From 4b20ac3dc63821223aa776326fc99770c501dc61 Mon Sep 17 00:00:00 2001
From: Frank Hale <frankhale@gmail.com>
Date: Fri, 7 Nov 2014 13:13:12 -0500
Subject: [PATCH] Fix Windows min/max animation on frameless windows

- Frameless windows disappeared or appears when minimized and maximized
on Windows. This commit fixes that.
---
 atom/browser/native_window_views.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc
index 0a17b1787b52..af069191b83d 100644
--- a/atom/browser/native_window_views.cc
+++ b/atom/browser/native_window_views.cc
@@ -226,6 +226,13 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
       options.Get(switches::kUseContentSize, &use_content_size_) &&
       use_content_size_)
     bounds = ContentBoundsToWindowBounds(bounds);
+  #if defined(OS_WIN)
+  else {
+    // set Window style so that we get a minimize and maximize animation when frameless
+    DWORD frame_style = WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION;
+    ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style);
+  }
+  #endif
 
   window_->UpdateWindowIcon();
   window_->CenterWindow(bounds.size());