fix: drag regions in child windows (manual backport 40-x-y) (#49312)

fix: drag regions in child windows
This commit is contained in:
Calvin
2026-01-06 07:32:12 -08:00
committed by GitHub
parent c4bfc1491a
commit ff23784246

View File

@@ -754,6 +754,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::CreateFrom(isolate, GetBrowserContext());
SetUserAgent(GetBrowserContext()->GetUserAgent());
@@ -1021,6 +1025,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());
@@ -1777,8 +1785,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);
}
}