From 1944472c2fdc059b491f96c93e9740ce545afe85 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 11 Jan 2016 13:43:24 +0800 Subject: [PATCH] docs: Make win.getNativeWindowHandle more clear --- atom/browser/api/atom_api_window.cc | 5 ++--- docs/api/browser-window.md | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 494d3fe..f32b6d1 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -594,9 +594,8 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) { v8::Local Window::GetNativeWindowHandle() { gfx::AcceleratedWidget handle = window_->GetAcceleratedWidget(); - return ToBuffer(isolate(), - static_cast(&handle), - sizeof(gfx::AcceleratedWidget)); + return ToBuffer( + isolate(), static_cast(&handle), sizeof(gfx::AcceleratedWidget)); } void Window::SetVisibleOnAllWorkspaces(bool visible) { diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index bb86e8e..5775199 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -63,9 +63,10 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. * `frame` Boolean - Specify `false` to create a [Frameless Window](frameless-window.md). Default is `true`. * `acceptFirstMouse` Boolean - Whether the web view accepts a single - mouse-down event that simultaneously activates the window. Default is `false`. - * `disableAutoHideCursor` Boolean - Whether to hide cursor when typing. Default - is `false`. + mouse-down event that simultaneously activates the window. Default is + `false`. + * `disableAutoHideCursor` Boolean - Whether to hide cursor when typing. + Default is `false`. * `autoHideMenuBar` Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is `false`. * `enableLargerThanScreen` Boolean - Enable the window to be resized larger @@ -157,7 +158,8 @@ The `webPreferences` option is an object that can have following properties: The `BrowserWindow` object emits the following events: -**Note:** Some events are only available on specific operating systems and are labeled as such. +**Note:** Some events are only available on specific operating systems and are +labeled as such. ### Event: 'page-title-updated' @@ -341,7 +343,8 @@ The unique ID of this window. Objects created with `new BrowserWindow` have the following instance methods: -**Note:** Some methods are only available on specific operating systems and are labeled as such. +**Note:** Some methods are only available on specific operating systems and are +labeled as such. ### `win.destroy()` @@ -573,9 +576,10 @@ Returns whether the window is in kiosk mode. ### `win.getNativeWindowHandle()` -Returns the platform-specific handle of the window in a buffer. -Cast it to the appropriate type, such as HWND for Windows, NSView* for OS X or unsigned long for Linux. -Used for OS's Native API's for windows. +Returns the platform-specific handle of the window as `Buffer`. + +The native type of the handle is `HWND` on Windows, `NSView*` on OS X, and +`Window` (`unsigned long`) on Linux. ### `win.hookWindowMessage(message, callback)` _Windows_ -- 2.7.4