From: Cheng Zhao Date: Sun, 18 May 2014 13:19:38 +0000 (+0800) Subject: win: Setting menu shouldn't change client area size. X-Git-Tag: v0.12.5~4^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0b202a2df1059552653b4f441f3cf2ef3e4b26c9;p=electron.git win: Setting menu shouldn't change client area size. --- diff --git a/atom/browser/native_window_win.cc b/atom/browser/native_window_win.cc index 56b79b20..b2563c21 100644 --- a/atom/browser/native_window_win.cc +++ b/atom/browser/native_window_win.cc @@ -391,6 +391,11 @@ void NativeWindowWin::SetMenu(ui::MenuModel* menu_model) { menu_.reset(new atom::Menu2(menu_model, true)); ::SetMenu(GetNativeWindow(), menu_->GetNativeMenu()); 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(