mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: drag regions in child windows (#49231)
* fix: drag regions in child windows * Update comments
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user