win: Setting menu shouldn't change client area size.
This commit is contained in:
parent
ee336b4218
commit
0b202a2df1
1 changed files with 5 additions and 0 deletions
|
@ -391,6 +391,11 @@ void NativeWindowWin::SetMenu(ui::MenuModel* menu_model) {
|
||||||
menu_.reset(new atom::Menu2(menu_model, true));
|
menu_.reset(new atom::Menu2(menu_model, true));
|
||||||
::SetMenu(GetNativeWindow(), menu_->GetNativeMenu());
|
::SetMenu(GetNativeWindow(), menu_->GetNativeMenu());
|
||||||
RegisterAccelerators();
|
RegisterAccelerators();
|
||||||
|
|
||||||
|
// Resize the window so SetMenu won't change client area size.
|
||||||
|
gfx::Size size = GetSize();
|
||||||
|
size.set_height(size.height() + GetSystemMetrics(SM_CYMENU));
|
||||||
|
SetSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowWin::UpdateDraggableRegions(
|
void NativeWindowWin::UpdateDraggableRegions(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue