electron/patches/chromium/webview_cross_drag.patch

34 lines
1.7 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-09-21 00:30:26 +00:00
From: Anonymous <anonymous@electronjs.org>
Date: Thu, 20 Sep 2018 17:47:04 -0700
Subject: webview_cross_drag.patch
2019-12-13 17:18:45 +00:00
This allows dragging and dropping between <webview>s.
Originally landed in https://github.com/electron/libchromiumcontent/pull/267
2018-09-21 00:30:26 +00:00
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index f2e42fd434ee9d94411a5e17c3ba6489d18cc12b..b7bbc57125d724c60e9692d9cd1728ae2bc452f5 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -797,6 +797,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
bool WebContentsViewAura::IsValidDragTarget(
RenderWidgetHostImpl* target_rwh) const {
+ return true;
return target_rwh->GetProcess()->GetID() == drag_start_process_id_ ||
GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
drag_start_view_id_;
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index b874b3c4b16ca87c9730c6caaf5788cff0ab3493..8931859b944905a80bb9d174a67d3aee0f0bf5d6 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -419,6 +419,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
}
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
+ return YES;
return targetRWH->GetProcess()->GetID() == _dragStartProcessID ||
GetRenderViewHostID(_webContents->GetRenderViewHost()) !=
_dragStartViewID;