From 3ca5b0ce23b302b9be80b49d39d6f5fd733933e3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 6 Jan 2016 23:02:33 +0800 Subject: [PATCH] win: Don't change transparent window's style Close #1952. --- atom/browser/native_window_views.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 1abb2ef..35e12ad 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -424,12 +424,14 @@ void NativeWindowViews::SetResizable(bool resizable) { // 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); + if (!transparent()) { + 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 -- 2.7.4