|
|
@@ -189,12 +189,15 @@
|
|
|
# `lynxExternalDropAtHook` (set by LYNX, ui/ExternalDrag.cpp) says that a screen point is a plugin's own editor (or
|
|
|
# another program's window above LYNX's): there the drag counts as outside (after 300 ms instead of 700, and even
|
|
|
# when a LYNX drop target is behind the plugin), and goes on as the file drag the plugin's own drop target gets.
|
|
|
-# Without the hook: JUCE's test only.
|
|
|
+# With the hook it alone decides: on X11 JUCE's Desktop::findComponentAt found nothing over LYNX's own windows
|
|
|
+# while the drag image (a window of ours that lets the mouse through) was under the mouse. Without it: JUCE's test.
|
|
|
# 33. Linux/BSD only, juce_gui_basics/native/juce_DragAndDrop_linux.cpp (issue #174): JUCE's XDND source sends a drag to
|
|
|
# the first XdndAware window under the pointer from the root down. Every JUCE window is XdndAware, so a plugin editor
|
|
|
-# embedded in a LYNX window (its own XdndAware X window, reparented into LYNX's XEmbed host) never got it: LYNX's
|
|
|
-# window took the drop. Below one of the app's OWN windows the search now goes on to a deeper XdndAware window (the
|
|
|
-# plugin's) and sends it there; another program's windows are searched as before.
|
|
|
+# embedded in a window (its own XdndAware X window, reparented into the host's XEmbed window: in LYNX's plugin window,
|
|
|
+# or in the window of LYNX's separate plugin process) never got it: the host's window took the drop and had nobody to
|
|
|
+# give it to. The search now goes on below an XdndAware window to the deepest XdndAware window under the pointer, the
|
|
|
+# one that receives it, as OLE (Windows) and AppKit (macOS) pick the innermost registered window. A program with one
|
|
|
+# XdndAware window (most) is reached as before.
|
|
|
#
|
|
|
# Used by CMake (lynx_patch_juce on the fetched JUCE) and by scripts/build-windows-zig.sh, which runs this file with
|
|
|
# `cmake -DJUCE_DIR=<a copy of JUCE's juce_gui_basics module> -P cmake/LynxPatchJuce.cmake`.
|
|
|
@@ -243,9 +246,9 @@ function(lynx_patch_juce_file file)
|
|
|
" dragInfo.clear();|NL| srcMimeTypeAtomList.clear();|NL||NL| dragAndDropCurrentMimeType = 0;"
|
|
|
" dragInfo.clear();|NL| srcMimeTypeAtomList.clear();|NL| finishAfterDropDataReceived = false; // LYNX patch (issue #11): not left over from a failed drop|NL||NL| dragAndDropCurrentMimeType = 0;")
|
|
|
|
|
|
- lynx_juce_fix("XDND target below our own windows" "LYNX patch (issue #174): below one of our own windows"
|
|
|
+ lynx_juce_fix("XDND target: the deepest aware window" "LYNX patch (issue #174): a deeper XdndAware window"
|
|
|
" if (isWindowDnDAware (target))|NL| return target;|NL|"
|
|
|
- " if (isWindowDnDAware (target))|NL| {|NL| // LYNX patch (issue #174): below one of our own windows a deeper XdndAware window (a hosted plugin's editor,|NL| // embedded through XEmbed) is the target, not our window around it|NL| if (getPeerFor (target) != nullptr)|NL| {|NL| ::Window lynxChild = None, lynxRoot;|NL| int lynxPos;|NL| unsigned int lynxMask;|NL||NL| if (X11Symbols::getInstance()->xQueryPointer (getDisplay(), target, &lynxRoot, &lynxChild, &lynxPos, &lynxPos, &lynxPos, &lynxPos, &lynxMask)|NL| && lynxChild != None)|NL| if (const auto deeper = externalFindDragTargetWindow (lynxChild); deeper != None)|NL| return deeper;|NL| }|NL||NL| return target;|NL| }|NL|")
|
|
|
+ " if (isWindowDnDAware (target))|NL| {|NL| // LYNX patch (issue #174): a deeper XdndAware window under the pointer (a plugin's editor embedded through|NL| // XEmbed) is the target, not the host window around it|NL| ::Window lynxChild = None, lynxRoot;|NL| int lynxPos;|NL| unsigned int lynxMask;|NL||NL| if (X11Symbols::getInstance()->xQueryPointer (getDisplay(), target, &lynxRoot, &lynxChild, &lynxPos, &lynxPos, &lynxPos, &lynxPos, &lynxMask)|NL| && lynxChild != None)|NL| if (const auto deeper = externalFindDragTargetWindow (lynxChild); deeper != None)|NL| return deeper;|NL||NL| return target;|NL| }|NL|")
|
|
|
elseif(file MATCHES "juce_DragAndDropContainer.cpp$")
|
|
|
lynx_juce_fix("external drop hook: declaration" "LYNX patch (issue #174): a place on screen"
|
|
|
"bool juce_performDragDropText (const String&, bool& shouldStop);|NL|"
|
|
|
@@ -255,7 +258,7 @@ function(lynx_patch_juce_file file)
|
|
|
" auto now = Time::getCurrentTime();|NL| // LYNX patch (issue #174): over a hosted plugin's editor no target of ours counts (it is the plugin's)|NL| const auto lynxOutside = lynxExternalDropAtHook != nullptr && lynxExternalDropAtHook (screenPos);|NL||NL| if (getCurrentlyOver() != nullptr && ! lynxOutside)|NL| lastTimeOverTarget = now;|NL| else if (now > lastTimeOverTarget + RelativeTime::milliseconds (lynxOutside ? 300 : 700))|NL| checkForExternalDrag (details, screenPos, lynxOutside);")
|
|
|
lynx_juce_fix("external drop hook: the test" "LYNX patch (issue #174): `outside`"
|
|
|
" void checkForExternalDrag (DragAndDropTarget::SourceDetails& details, Point<int> screenPos)|NL| {|NL| if (! hasCheckedForExternalDrag)|NL| {|NL| if (Desktop::getInstance().findComponentAt (screenPos) == nullptr)"
|
|
|
- " // LYNX patch (issue #174): `outside`: the hook said the point is a plugin's editor or another program's window|NL| void checkForExternalDrag (DragAndDropTarget::SourceDetails& details, Point<int> screenPos, bool outside = false)|NL| {|NL| if (! hasCheckedForExternalDrag)|NL| {|NL| if (outside || Desktop::getInstance().findComponentAt (screenPos) == nullptr)")
|
|
|
+ " // LYNX patch (issue #174): `outside`: the hook said the point is a plugin's editor or another program's window.|NL| // With the hook it alone decides (on X11 findComponentAt found nothing over our own windows: the drag image|NL| // under the mouse, a window of ours, counted as covering them).|NL| void checkForExternalDrag (DragAndDropTarget::SourceDetails& details, Point<int> screenPos, bool outside = false)|NL| {|NL| if (! hasCheckedForExternalDrag)|NL| {|NL| if (lynxExternalDropAtHook != nullptr ? outside : Desktop::getInstance().findComponentAt (screenPos) == nullptr)")
|
|
|
elseif(file MATCHES "juce_PopupMenu.cpp$")
|
|
|
lynx_juce_fix("submenu corridor" "LYNX patch (issue #18): the way across"
|
|
|
" return areaTowardsSubMenu.contains (newGlobalPos.toFloat());|NL| }"
|