fix: drag regions in child windows (#49231)

* fix: drag regions in child windows

* Update comments
This commit is contained in:
Calvin
2026-01-05 07:34:01 -08:00
committed by GitHub
parent 75ea93a279
commit 46922de638

View File

@@ -760,6 +760,10 @@ WebContents::WebContents(v8::Isolate* isolate,
script_executor_ = std::make_unique<extensions::ScriptExecutor>(web_contents);
#endif
// TODO: This works for main frames, but does not work for child frames.
// See: https://github.com/electron/electron/issues/49256
web_contents->SetSupportsDraggableRegions(true);
session_ = Session::FromOrCreate(isolate, GetBrowserContext());
SetUserAgent(GetBrowserContext()->GetUserAgent());
@@ -1027,6 +1031,10 @@ void WebContents::InitWithWebContents(
browser_context_ = browser_context;
web_contents->SetDelegate(this);
// TODO: This works for main frames, but does not work for child frames.
// See: https://github.com/electron/electron/issues/49256
web_contents->SetSupportsDraggableRegions(true);
#if BUILDFLAG(ENABLE_PRINTING)
PrintViewManagerElectron::CreateForWebContents(web_contents.get());
printing::CreateCompositeClientIfNeeded(web_contents.get(), GetUserAgent());
@@ -1783,8 +1791,6 @@ void WebContents::RenderFrameCreated(
auto details = gin_helper::Dictionary::CreateEmpty(isolate);
details.SetGetter("frame", render_frame_host);
Emit("frame-created", details);
content::WebContents::FromRenderFrameHost(render_frame_host)
->SetSupportsDraggableRegions(true);
}
}