]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix Windows min/max animation on frameless windows
authorFrank Hale <frankhale@gmail.com>
Fri, 7 Nov 2014 18:13:12 +0000 (13:13 -0500)
committerFrank Hale <frankhale@gmail.com>
Fri, 7 Nov 2014 18:13:12 +0000 (13:13 -0500)
- Frameless windows disappeared or appears when minimized and maximized
on Windows. This commit fixes that.

atom/browser/native_window_views.cc

index 0a17b1787b525fe3002981e4fccfd667071b1fb7..af069191b83d37a991b22a6a2dd58c50a4618945 100644 (file)
@@ -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());