mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: WCO occlusion of DevTools (#35309)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -173,6 +173,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "printing/backend/win_helper.h"
|
||||
#include "shell/browser/native_window_views.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2420,6 +2421,14 @@ void WebContents::OpenDevTools(gin::Arguments* args) {
|
||||
}
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
auto* win = static_cast<NativeWindowViews*>(owner_window());
|
||||
// Force a detached state when WCO is enabled to match Chrome
|
||||
// behavior and prevent occlusion of DevTools.
|
||||
if (win && win->IsWindowControlsOverlayEnabled())
|
||||
state = "detach";
|
||||
#endif
|
||||
|
||||
DCHECK(inspectable_web_contents_);
|
||||
inspectable_web_contents_->SetDockState(state);
|
||||
inspectable_web_contents_->ShowDevTools(activate);
|
||||
|
||||
Reference in New Issue
Block a user