fix: draggable regions not working (#41030)

* fix: draggable regions not working

* fix: only support app regions for main frame

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
Shelley Vohr 2024-01-25 01:12:54 +01:00 committed by GitHub
parent a05bfd332d
commit 3e6a038af7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 212 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_script_source.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" // nogncheck
#include "ui/base/resource/resource_bundle.h"
@ -55,6 +56,11 @@ ElectronRenderFrameObserver::ElectronRenderFrameObserver(
renderer_client_(renderer_client) {
// Initialise resource for directory listing.
net::NetModule::SetResourceProvider(NetResourceProvider);
// App regions are only supported in the main frame.
auto* main_frame = frame->GetMainRenderFrame();
if (main_frame && main_frame == frame)
render_frame_->GetWebView()->SetSupportsAppRegion(true);
}
void ElectronRenderFrameObserver::DidClearWindowObject() {