Added option to prevent a window from being moved on OS X
authorevgenyzinoviev <me@ch1p.com>
Fri, 15 Jan 2016 02:45:19 +0000 (03:45 +0100)
committerevgenyzinoviev <me@ch1p.com>
Fri, 15 Jan 2016 02:58:57 +0000 (03:58 +0100)
atom/browser/native_window_mac.mm
atom/common/options_switches.cc
atom/common/options_switches.h
docs/api/browser-window.md

index 2d75a68..8f76991 100644 (file)
@@ -452,6 +452,11 @@ NativeWindowMac::NativeWindowMac(
     set_force_using_draggable_region(true);
   }
 
+  bool movable;
+  if (options.Get(options::kMovable, &movable)) {
+    [window_ setMovable:movable];
+  }
+
   // On OS X the initial window size doesn't include window frame.
   bool use_content_size = false;
   options.Get(options::kUseContentSize, &use_content_size);
index 6c4e847..477fe67 100644 (file)
@@ -22,6 +22,7 @@ const char kMinHeight[]  = "minHeight";
 const char kMaxWidth[]   = "maxWidth";
 const char kMaxHeight[]  = "maxHeight";
 const char kResizable[]  = "resizable";
+const char kMovable[]    = "movable";
 const char kFullscreen[] = "fullscreen";
 
 // Whether the window should show in taskbar.
index f038521..78de53b 100644 (file)
@@ -23,6 +23,7 @@ extern const char kMinHeight[];
 extern const char kMaxWidth[];
 extern const char kMaxHeight[];
 extern const char kResizable[];
+extern const char kMovable[];
 extern const char kFullscreen[];
 extern const char kSkipTaskbar[];
 extern const char kKiosk[];
index 61180d5..211b23a 100644 (file)
@@ -47,6 +47,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
   * `maxWidth` Integer - Window's maximum width. Default is no limit.
   * `maxHeight` Integer - Window's maximum height. Default is no limit.
   * `resizable` Boolean - Whether window is resizable. Default is `true`.
+  * `movable` Boolean - Whether window is movable. Default is `true`.
   * `alwaysOnTop` Boolean - Whether the window should always stay on top of
     other windows. Default is `false`.
   * `fullscreen` Boolean - Whether the window should show in fullscreen. When