electron/spec/is-valid-window/src/impl_darwin.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
284 B
Text
Raw Normal View History

#include "impl.h"
#include <Cocoa/Cocoa.h>
namespace impl {
bool IsValidWindow(char* handle, size_t size) {
if (size != sizeof(NSView*))
return false;
NSView* view = *reinterpret_cast<NSView**>(handle);
return [view isKindOfClass:[NSView class]];
}
} // namespace impl