2018-10-24 18:24:11 +00:00
|
|
|
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
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
|
2023-02-03 11:43:42 +00:00
|
|
|
index 78ce9650aad29217d786e55a93ffd4c26e10d3a4..812777a6bd88a50bb90a7f5a6bf3c061284e1380 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/web_contents/web_contents_view_aura.cc
|
|
|
|
+++ b/content/browser/web_contents/web_contents_view_aura.cc
|
2023-01-06 02:35:34 +00:00
|
|
|
@@ -919,10 +919,7 @@ bool WebContentsViewAura::IsValidDragTarget(
|
2022-03-25 01:39:03 +00:00
|
|
|
// for the outermost view. Inner `WebContents` will have a
|
|
|
|
// `WebContentsViewChildFrame` so when dragging between an inner
|
|
|
|
// `WebContents` and its embedder the view IDs will be the same.
|
|
|
|
- bool cross_tab_drag =
|
|
|
|
- GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
|
|
|
|
- drag_start_->view_id;
|
|
|
|
- return cross_tab_drag;
|
2018-09-14 05:02:16 +00:00
|
|
|
+ return true;
|
2020-04-06 20:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
|
2023-02-03 11:43:42 +00:00
|
|
|
index 1af80994a4a64cce27dfc8a46e6cb68bbbd51b1b..a2f1aa2f1a9792bb6978173c30cc2b9bb18108ab 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/web_contents/web_drag_dest_mac.mm
|
|
|
|
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
|
2023-01-06 02:35:34 +00:00
|
|
|
@@ -389,9 +389,7 @@ - (void)resetDragStartTrackers {
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
|
2020-04-06 20:09:52 +00:00
|
|
|
- return targetRWH->GetProcess()->GetID() == _dragStartProcessID ||
|
|
|
|
- GetRenderViewHostID(_webContents->GetRenderViewHost()) !=
|
|
|
|
- _dragStartViewID;
|
2018-09-14 05:02:16 +00:00
|
|
|
+ return YES;
|
2020-04-06 20:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|