From 4b20ac3dc63821223aa776326fc99770c501dc61 Mon Sep 17 00:00:00 2001 From: Frank Hale Date: Fri, 7 Nov 2014 13:13:12 -0500 Subject: [PATCH 1/3] 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()); From 24f8c5195986ef991ba949bec4b2da9deaf3ef23 Mon Sep 17 00:00:00 2001 From: Frank Hale Date: Fri, 7 Nov 2014 13:34:52 -0500 Subject: [PATCH 2/3] Make sure frame is frameless --- atom/browser/native_window_views.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index af069191b83d..35c0f1c65681 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -226,13 +226,14 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents, options.Get(switches::kUseContentSize, &use_content_size_) && use_content_size_) bounds = ContentBoundsToWindowBounds(bounds); - #if defined(OS_WIN) - else { + +#if defined(OS_WIN) + if (!has_frame_) { // 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 +#endif window_->UpdateWindowIcon(); window_->CenterWindow(bounds.size()); From e0dae4054ac49046eb6afbb3cd334efcbb9e5305 Mon Sep 17 00:00:00 2001 From: Frank Hale Date: Tue, 11 Nov 2014 13:09:54 -0500 Subject: [PATCH 3/3] Fix code style to be <= 80 lines --- atom/browser/native_window_views.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 35c0f1c65681..6a105ab7dca1 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -229,8 +229,10 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents, #if defined(OS_WIN) if (!has_frame_) { - // 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; + // 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