From 73553032ea99929b1511d6e873ec81328a42a356 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 6 Oct 2023 02:26:31 +0200 Subject: [PATCH] fix: toggling DevTools while minimized on Windows (#40091) fix: toggling devtools while minimized on Windows --- .../ui/views/inspectable_web_contents_view_views.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc index 8fb4d4c61e..cf9e7f47d7 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc @@ -142,8 +142,11 @@ void InspectableWebContentsViewViews::CloseDevTools() { devtools_visible_ = false; if (devtools_window_) { - inspectable_web_contents()->SaveDevToolsBounds( - devtools_window_->GetWindowBoundsInScreen()); + auto save_bounds = devtools_window_->IsMinimized() + ? devtools_window_->GetRestoredBounds() + : devtools_window_->GetWindowBoundsInScreen(); + inspectable_web_contents()->SaveDevToolsBounds(save_bounds); + devtools_window_.reset(); devtools_window_web_view_ = nullptr; devtools_window_delegate_ = nullptr;