fix: send NSView* as the response to getNativeWindowHandle() instead of a null handle (#15521) (#15803)

This commit is contained in:
Tom Moor 2018-11-27 18:00:37 -08:00 committed by Cheng Zhao
parent 3ed5a24c72
commit 250a09a43f
6 changed files with 22 additions and 2 deletions

View file

@ -9,6 +9,7 @@
#include <wrl/client.h>
#endif
#include <tuple>
#include <vector>
#include "atom/browser/api/atom_api_web_contents.h"
@ -1046,6 +1047,11 @@ gfx::AcceleratedWidget NativeWindowViews::GetAcceleratedWidget() const {
return GetNativeWindow()->GetHost()->GetAcceleratedWidget();
}
std::tuple<void*, int> NativeWindowViews::GetNativeWindowHandlePointer() const {
gfx::AcceleratedWidget handle = GetAcceleratedWidget();
return std::make_tuple(static_cast<void*>(&handle), sizeof(handle));
}
gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
const gfx::Rect& bounds) const {
if (!has_frame())