Browse Source

Merge pull request #1585 from joshaber/no-texture

Use the standard window background
Cheng Zhao 10 years ago
parent
commit
9e3f108fad

+ 10 - 3
atom/browser/native_window_mac.mm

@@ -310,11 +310,18 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
       width,
       height);
 
+  bool useStandardWindow = false;
+  options.Get(switches::kStandardWindow, &useStandardWindow);
+
+  NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask |
+                         NSMiniaturizableWindowMask | NSResizableWindowMask;
+  if (!useStandardWindow) {
+    styleMask |= NSTexturedBackgroundWindowMask;
+  }
+
   window_.reset([[AtomNSWindow alloc]
       initWithContentRect:cocoa_bounds
-                styleMask:NSTitledWindowMask | NSClosableWindowMask |
-                          NSMiniaturizableWindowMask | NSResizableWindowMask |
-                          NSTexturedBackgroundWindowMask
+                styleMask:styleMask
                   backing:NSBackingStoreBuffered
                     defer:YES]);
   [window_ setShell:this];

+ 3 - 0
atom/common/options_switches.cc

@@ -84,6 +84,9 @@ const char kType[] = "type";
 // Disable auto-hiding cursor.
 const char kDisableAutoHideCursor[] = "disable-auto-hide-cursor";
 
+// Use the OS X's standard window instead of the textured window.
+const char kStandardWindow[] = "standard-window";
+
 // Web runtime features.
 const char kExperimentalFeatures[]       = "experimental-features";
 const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";

+ 1 - 0
atom/common/options_switches.h

@@ -44,6 +44,7 @@ extern const char kPreloadScript[];
 extern const char kTransparent[];
 extern const char kType[];
 extern const char kDisableAutoHideCursor[];
+extern const char kStandardWindow[];
 
 extern const char kExperimentalFeatures[];
 extern const char kExperimentalCanvasFeatures[];

+ 2 - 0
docs/api/browser-window.md

@@ -72,6 +72,8 @@ You can also create a window without chrome by using
   * `type` String - Specifies the type of the window, possible types are
     `desktop`, `dock`, `toolbar`, `splash`, `notification`. This only works on
     Linux.
+  * `standard-window` Boolean - Use the OS X's standard window instead of the
+    textured window. Defaults to `false`.
   * `web-preferences` Object - Settings of web page's features
     * `javascript` Boolean
     * `web-security` Boolean