Browse Source

kVibrancyType should be read in InitFromOptions

Cheng Zhao 7 years ago
parent
commit
5a95aaaa54
2 changed files with 6 additions and 5 deletions
  1. 6 0
      atom/browser/native_window.cc
  2. 0 5
      atom/browser/native_window_mac.mm

+ 6 - 0
atom/browser/native_window.cc

@@ -131,6 +131,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
   if (options.Get(options::kKiosk, &kiosk) && kiosk) {
     SetKiosk(kiosk);
   }
+#if defined(OS_MACOSX)
+  std::string type;
+  if (options.Get(options::kVibrancyType, &type)) {
+    SetVibrancy(type);
+  }
+#endif
   std::string color;
   if (options.Get(options::kBackgroundColor, &color)) {
     SetBackgroundColor(ParseHexColor(color));

+ 0 - 5
atom/browser/native_window_mac.mm

@@ -970,11 +970,6 @@ NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
       return event;
   }];
 
-  std::string type;
-  if (options.Get(options::kVibrancyType, &type)) {
-    SetVibrancy(type);
-  }
-
   // Set maximizable state last to ensure zoom button does not get reset
   // by calls to other APIs.
   SetMaximizable(maximizable);