mac: Fix a crash when closing window
This commit is contained in:
parent
8506725b54
commit
5b312e8f64
1 changed files with 5 additions and 4 deletions
|
@ -296,9 +296,7 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
AtomNSWindow* atomWindow;
|
AtomNSWindow* atomWindow = [[AtomNSWindow alloc]
|
||||||
|
|
||||||
atomWindow = [[AtomNSWindow alloc]
|
|
||||||
initWithContentRect:cocoa_bounds
|
initWithContentRect:cocoa_bounds
|
||||||
styleMask:NSTitledWindowMask | NSClosableWindowMask |
|
styleMask:NSTitledWindowMask | NSClosableWindowMask |
|
||||||
NSMiniaturizableWindowMask | NSResizableWindowMask |
|
NSMiniaturizableWindowMask | NSResizableWindowMask |
|
||||||
|
@ -666,7 +664,10 @@ void NativeWindowMac::ShowDefinitionForSelection() {
|
||||||
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
|
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
|
||||||
if (!draggable_region_)
|
if (!draggable_region_)
|
||||||
return false;
|
return false;
|
||||||
NSView* webView = GetWebContents()->GetNativeView();
|
content::WebContents* web_contents = GetWebContents();
|
||||||
|
if (!web_contents)
|
||||||
|
return false;
|
||||||
|
NSView* webView = web_contents->GetNativeView();
|
||||||
NSInteger webViewHeight = NSHeight([webView bounds]);
|
NSInteger webViewHeight = NSHeight([webView bounds]);
|
||||||
// |draggable_region_| is stored in local platform-indepdent coordiate system
|
// |draggable_region_| is stored in local platform-indepdent coordiate system
|
||||||
// while |point| is in local Cocoa coordinate system. Do the conversion
|
// while |point| is in local Cocoa coordinate system. Do the conversion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue