From dbddf5028a8562d92a818a2a679bc27f8cae86c6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 4 Aug 2016 13:17:04 -0700 Subject: [PATCH] Adjust y position if menu bar is visible --- atom/browser/native_window_views.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index bb5455fddcd5..52e643f3589e 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -1164,8 +1164,10 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds( window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds)); #endif - if (menu_bar_ && menu_bar_visible_) + if (menu_bar_ && menu_bar_visible_) { + window_bounds.set_y(window_bounds.y() - kMenuBarHeight); window_bounds.set_height(window_bounds.height() + kMenuBarHeight); + } return window_bounds; } @@ -1190,8 +1192,10 @@ gfx::Rect NativeWindowViews::WindowBoundsToContentBounds( display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size())); #endif - if (menu_bar_ && menu_bar_visible_) + if (menu_bar_ && menu_bar_visible_) { + content_bounds.set_y(content_bounds.y() + kMenuBarHeight); content_bounds.set_height(content_bounds.height() - kMenuBarHeight); + } return content_bounds; }