From a8cd101ff5cb33136c6c28d6d63c77f01801bf82 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 5 Aug 2014 18:17:14 +0800 Subject: [PATCH] win: Fix window frame when DWM is disabled, closes #519. --- atom/browser/native_window_views.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index dd672b281b..9dfbe89a6c 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -45,6 +45,7 @@ #elif defined(OS_WIN) #include "atom/browser/ui/views/win_frame_view.h" #include "base/win/scoped_comptr.h" +#include "ui/base/win/shell.h" #endif namespace atom { @@ -480,9 +481,11 @@ views::ClientView* NativeWindowViews::CreateClientView(views::Widget* widget) { views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView( views::Widget* widget) { #if defined(OS_WIN) - WinFrameView* frame_view = new WinFrameView; - frame_view->Init(this, widget); - return frame_view; + if (ui::win::IsAeroGlassEnabled()) { + WinFrameView* frame_view = new WinFrameView; + frame_view->Init(this, widget); + return frame_view; + } #elif defined(OS_LINUX) if (has_frame_) { return new views::NativeFrameView(widget); @@ -491,9 +494,9 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView( frame_view->Init(this, widget); return frame_view; } -#else - return NULL; #endif + + return NULL; } void NativeWindowViews::HandleKeyboardEvent(