Fix linux and mac build errors
authorOmri Litov <omrilitov@gmail.com>
Thu, 7 Jan 2016 22:27:53 +0000 (00:27 +0200)
committerOmri Litov <omrilitov@gmail.com>
Thu, 7 Jan 2016 22:27:53 +0000 (00:27 +0200)
atom/browser/api/atom_api_window.cc
atom/browser/native_window_mac.mm

index c9410d1..494d3fe 100644 (file)
@@ -107,7 +107,6 @@ void TranslateOldOptions(v8::Isolate* isolate, v8::Local<v8::Object> options) {
   }
 }
 
-#if defined(OS_WIN)
 // Converts binary data to Buffer.
 v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
   auto buffer = node::Buffer::New(isolate, static_cast<char*>(val), size);
@@ -116,7 +115,6 @@ v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
   else
     return buffer.ToLocalChecked();
 }
-#endif
 
 }  // namespace
 
@@ -596,7 +594,9 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
 
 v8::Local<v8::Value> Window::GetNativeWindowHandle() {
   gfx::AcceleratedWidget handle = window_->GetAcceleratedWidget();
-  return ToBuffer(isolate(), static_cast<void*>(&handle), sizeof(gfx::AcceleratedWidget));
+  return ToBuffer(isolate(),
+    static_cast<void*>(&handle),
+    sizeof(gfx::AcceleratedWidget));
 }
 
 void Window::SetVisibleOnAllWorkspaces(bool visible) {
index 4340677..2d75a68 100644 (file)
@@ -732,7 +732,7 @@ gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
 }
 
 gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() {
-  return window_;
+  return inspectable_web_contents()->GetView()->GetNativeView();
 }
 
 void NativeWindowMac::SetProgressBar(double progress) {