Browse Source

fix: toggling DevTools while minimized on Windows (#40116)

fix: toggling devtools while minimized on Windows

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 1 year ago
parent
commit
d95f28c194
1 changed files with 5 additions and 2 deletions
  1. 5 2
      shell/browser/ui/views/inspectable_web_contents_view_views.cc

+ 5 - 2
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;