Merge pull request #4111 from evgenyzinoviev/movable

Added an option to prevent a window from being moved on OS X
This commit is contained in:
Cheng Zhao 2016-01-15 23:24:22 +08:00
commit 0937144849
4 changed files with 9 additions and 0 deletions

View 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);

View 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.

View 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[];

View file

@ -47,6 +47,8 @@ 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. This is only implemented
on OS X. 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