fix: fire show event when BrowserWindow shown via maximize() (#33214)

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
This commit is contained in:
trop[bot]
2022-03-21 20:33:20 -04:00
committed by GitHub
parent cee4e3707f
commit dcf825bed6
3 changed files with 31 additions and 5 deletions

View File

@@ -580,11 +580,13 @@ void NativeWindowViews::SetEnabledInternal(bool enable) {
#if BUILDFLAG(IS_LINUX)
void NativeWindowViews::Maximize() {
if (IsVisible())
if (IsVisible()) {
widget()->Maximize();
else
} else {
widget()->native_widget_private()->Show(ui::SHOW_STATE_MAXIMIZED,
gfx::Rect());
NotifyWindowShow();
}
}
#endif

View File

@@ -178,12 +178,13 @@ HHOOK NativeWindowViews::mouse_hook_ = NULL;
void NativeWindowViews::Maximize() {
// Only use Maximize() when window is NOT transparent style
if (!transparent()) {
if (IsVisible())
if (IsVisible()) {
widget()->Maximize();
else
} else {
widget()->native_widget_private()->Show(ui::SHOW_STATE_MAXIMIZED,
gfx::Rect());
return;
NotifyWindowShow();
}
} else {
restore_bounds_ = GetBounds();
auto display = display::Screen::GetScreen()->GetDisplayNearestWindow(