Procházet zdrojové kódy

Self-test details190td: item 73's synthetic clip drag runs on Linux and Windows only

On macOS JUCE finds the component under a mouse event through NSWindow windowNumberAtPoint
(NSViewComponentPeer::contains). The window the check had just put on the desktop was not the
system's window at that point yet, so the events reached no component and no drag could start:
rollup 0.1.33 step 18's Tests run failed "item 73: the clip drag started" on macOS only. The
check now skips that part on macOS with a note in its log, as round190te's #357 window part does.
The Esc handling it tests (ClipGridComponent::cancelClipDrag) is the same code on every system.
Ka1-S před 5 dny
rodič
revize
b688f43cfb
1 změnil soubory, kde provedl 12 přidání a 1 odebrání
  1. 12 1
      src/Details190tdCheck.inc

+ 12 - 1
src/Details190tdCheck.inc

@@ -4,7 +4,8 @@
     //    the editing code (AudioEngine::editSong's action, NamedEdit) and kept over undo / redo and a gesture;
     //  - D1: the LYNX extra "Esc clears the selection first" (on: LYNX's #217; off: FL closes the Playlist, keeps it);
     //  - item 75: a clip an undo brings back is selected (FL 2026, capture A8.2);
-    //  - item 73: Live's Esc ends a clip drag in the Session grid (through the window peer, when a display is there);
+    //  - item 73: Live's Esc ends a clip drag in the Session grid (through the window peer, when a display is there;
+    //    Linux / Windows: see the note at the check);
     //  - item 78: the Clip-launch Browser's "No Results".
     juce::String details190tdCheck (juce::String& log)
     {
@@ -254,6 +255,12 @@
         layoutstyle::setCurrent (layoutstyle::Style::pattern);
 
         // --- item 73: Esc ends a Session clip drag (Live L3), through the window peer -----------------------------------
+        // (Linux / Windows only, as round190te's #357 window part. On macOS JUCE finds the component under a mouse event
+        // through NSWindow windowNumberAtPoint (NSViewComponentPeer::contains): a window this check has just put on the
+        // desktop is not the window there yet (or another one covers it), so the events reach no component and no drag
+        // can start; rollup 0.1.33 step 18's Tests run failed "item 73: the clip drag started" on macOS for that reason.
+        // The Esc handling itself (ClipGridComponent: cancelClipDrag) is the same code on every system.)
+       #if JUCE_LINUX || JUCE_WINDOWS
         if (juce::Desktop::getInstance().getDisplays().getPrimaryDisplay() != nullptr)
         {
             AudioEngine engine (false);
@@ -304,6 +311,10 @@
         }
         else
             log << "skip item 73: no display\n";
+       #else
+        log << "skip item 73 on macOS: synthetic events through a window peer reach no component there (the window is not the "
+               "system's window at that point yet); Linux and Windows cover it\n";
+       #endif
         return result;
     }