mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
fix: drag regions in child windows (manual backport 40-x-y) (#49312)
fix: drag regions in child windows
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user