Skip to content

Commit dbddf50

Browse files
committed
Adjust y position if menu bar is visible
1 parent 2a20630 commit dbddf50

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

atom/browser/native_window_views.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,10 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
11641164
window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds));
11651165
#endif
11661166

1167-
if (menu_bar_ && menu_bar_visible_)
1167+
if (menu_bar_ && menu_bar_visible_) {
1168+
window_bounds.set_y(window_bounds.y() - kMenuBarHeight);
11681169
window_bounds.set_height(window_bounds.height() + kMenuBarHeight);
1170+
}
11691171
return window_bounds;
11701172
}
11711173

@@ -1190,8 +1192,10 @@ gfx::Rect NativeWindowViews::WindowBoundsToContentBounds(
11901192
display::win::ScreenWin::ScreenToDIPSize(hwnd, content_bounds.size()));
11911193
#endif
11921194

1193-
if (menu_bar_ && menu_bar_visible_)
1195+
if (menu_bar_ && menu_bar_visible_) {
1196+
content_bounds.set_y(content_bounds.y() + kMenuBarHeight);
11941197
content_bounds.set_height(content_bounds.height() - kMenuBarHeight);
1198+
}
11951199
return content_bounds;
11961200
}
11971201

0 commit comments

Comments
 (0)