mac: Always call SetSize for framless window
This commit is contained in:
parent
f25cf7481f
commit
3ea878941b
1 changed files with 6 additions and 1 deletions
|
@ -357,7 +357,7 @@ NativeWindowMac::NativeWindowMac(
|
||||||
// On OS X the initial window size doesn't include window frame.
|
// On OS X the initial window size doesn't include window frame.
|
||||||
bool use_content_size = false;
|
bool use_content_size = false;
|
||||||
options.Get(switches::kUseContentSize, &use_content_size);
|
options.Get(switches::kUseContentSize, &use_content_size);
|
||||||
if (has_frame_ && !use_content_size)
|
if (!has_frame_ || !use_content_size)
|
||||||
SetSize(gfx::Size(width, height));
|
SetSize(gfx::Size(width, height));
|
||||||
|
|
||||||
// Enable the NSView to accept first mouse event.
|
// Enable the NSView to accept first mouse event.
|
||||||
|
@ -494,6 +494,11 @@ gfx::Rect NativeWindowMac::GetBounds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowMac::SetContentSize(const gfx::Size& size) {
|
void NativeWindowMac::SetContentSize(const gfx::Size& size) {
|
||||||
|
if (!has_frame_) {
|
||||||
|
SetSize(size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NSRect frame_nsrect = [window_ frame];
|
NSRect frame_nsrect = [window_ frame];
|
||||||
NSSize frame = frame_nsrect.size;
|
NSSize frame = frame_nsrect.size;
|
||||||
NSSize content = [window_ contentRectForFrameRect:frame_nsrect].size;
|
NSSize content = [window_ contentRectForFrameRect:frame_nsrect].size;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue