]> khamidou — GitHub mirrors - electron.git/commitdiff
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 2d75a682c653990e52a985d576676d6c5edce9b9..8f76991404749296e70e27e805f65fcb56c82a98 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 6c4e8477cc4adde020759f9618d85960375432ec..477fe6755faffd0b115c2dfc056b83a05c18f4fc 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 f038521673a0ad3e34c2508285091ae5be95ca54..78de53b825f96ea09bb62e520065b011d16b5278 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 61180d5b89a9e6d4f510c320ceab4a2447116013..211b23a5eb9ee5f0ae73d801d735fcc0d54abedf 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