You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

468 lines
21KB

  1. diff --git a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  2. index 7642040bd..ed02448b8 100644
  3. --- a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  4. +++ b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp
  5. @@ -842,6 +842,26 @@ namespace WavFileHelpers
  6. return out.getMemoryBlock();
  7. }
  8. };
  9. +
  10. + //==============================================================================
  11. + struct Clm_Chunk
  12. + {
  13. + static MemoryBlock createFrom (const StringPairArray& values)
  14. + {
  15. + MemoryOutputStream out;
  16. + auto s = values["clm "];
  17. +
  18. + if (s.isNotEmpty())
  19. + {
  20. + out.writeString (s);
  21. +
  22. + if ((out.getDataSize() & 1) != 0)
  23. + out.writeByte(0);
  24. + }
  25. +
  26. + return out.getMemoryBlock();
  27. + }
  28. + };
  29. //==============================================================================
  30. namespace AXMLChunk
  31. @@ -1321,6 +1341,7 @@ public:
  32. listInfoChunk = ListInfoChunk::createFrom (metadataValues);
  33. acidChunk = AcidChunk::createFrom (metadataValues);
  34. trckChunk = TracktionChunk::createFrom (metadataValues);
  35. + clm_Chunk = Clm_Chunk::createFrom (metadataValues);
  36. }
  37. headerPosition = out->getPosition();
  38. @@ -1383,7 +1404,7 @@ public:
  39. }
  40. private:
  41. - MemoryBlock tempBlock, bwavChunk, axmlChunk, smplChunk, instChunk, cueChunk, listChunk, listInfoChunk, acidChunk, trckChunk;
  42. + MemoryBlock tempBlock, bwavChunk, axmlChunk, smplChunk, instChunk, cueChunk, listChunk, listInfoChunk, acidChunk, trckChunk, clm_Chunk;
  43. uint64 lengthInSamples = 0, bytesWritten = 0;
  44. int64 headerPosition = 0;
  45. bool writeFailed = false;
  46. @@ -1421,6 +1442,7 @@ private:
  47. + chunkSize (listInfoChunk)
  48. + chunkSize (acidChunk)
  49. + chunkSize (trckChunk)
  50. + + chunkSize (clm_Chunk)
  51. + (8 + 28)); // (ds64 chunk)
  52. riffChunkSize += (riffChunkSize & 1);
  53. @@ -1503,6 +1525,7 @@ private:
  54. writeChunk (listInfoChunk, chunkName ("LIST"));
  55. writeChunk (acidChunk, chunkName ("acid"));
  56. writeChunk (trckChunk, chunkName ("Trkn"));
  57. + writeChunk (clm_Chunk, chunkName ("clm "));
  58. writeChunkHeader (chunkName ("data"), isRF64 ? -1 : (int) (lengthInSamples * bytesPerFrame));
  59. diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  60. index 7909098c9..19eb385fd 100644
  61. --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  62. +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  63. @@ -28,6 +28,9 @@
  64. //==============================================================================
  65. #if JucePlugin_Build_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)
  66. +#if JUCE_LINUX^M
  67. + #include <arpa/inet.h>^M
  68. +#endif^M
  69. #if JUCE_PLUGINHOST_VST3
  70. #if JUCE_MAC
  71. @@ -2618,6 +2621,9 @@ public:
  72. //==============================================================================
  73. void processParameterChanges (Vst::IParameterChanges& paramChanges)
  74. {
  75. + if (juceVST3EditController == nullptr)
  76. + return;
  77. +
  78. jassert (pluginInstance != nullptr);
  79. auto numParamsChanged = paramChanges.getParameterCount();
  80. diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  81. index 50cae68ed..549d8edb8 100644
  82. --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  83. +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp
  84. @@ -393,6 +393,7 @@ public:
  85. AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
  86. TRANS("Error when trying to open audio device!"),
  87. error);
  88. + resized();
  89. }
  90. bool showDeviceControlPanel()
  91. @@ -1120,6 +1121,8 @@ void AudioDeviceSelectorComponent::updateMidiOutput()
  92. deviceManager.setDefaultMidiOutputDevice ({});
  93. else
  94. deviceManager.setDefaultMidiOutputDevice (currentMidiOutputs[selectedId - 1].identifier);
  95. +
  96. + resized();
  97. }
  98. void AudioDeviceSelectorComponent::changeListenerCallback (ChangeBroadcaster*)
  99. diff --git a/modules/juce_core/native/juce_curl_Network.cpp b/modules/juce_core/native/juce_curl_Network.cpp
  100. index 00d428350..dd3375ff7 100644
  101. --- a/modules/juce_core/native/juce_curl_Network.cpp
  102. +++ b/modules/juce_core/native/juce_curl_Network.cpp
  103. @@ -332,6 +332,9 @@ public:
  104. // or 3) data is in the in buffer
  105. while ((! finished) && curlBuffer.getSize() == 0)
  106. {
  107. + if (Thread::currentThreadShouldExit())
  108. + return false;
  109. +
  110. {
  111. const ScopedLock lock (cleanupLock);
  112. diff --git a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h
  113. index 7f64d433d..e9360e0de 100644
  114. --- a/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h
  115. +++ b/modules/juce_dsp/native/juce_sse_SIMDNativeOps.h
  116. @@ -74,6 +74,7 @@ struct SIMDNativeOps<float>
  117. static forcedinline __m128 JUCE_VECTOR_CALLTYPE add (__m128 a, __m128 b) noexcept { return _mm_add_ps (a, b); }
  118. static forcedinline __m128 JUCE_VECTOR_CALLTYPE sub (__m128 a, __m128 b) noexcept { return _mm_sub_ps (a, b); }
  119. static forcedinline __m128 JUCE_VECTOR_CALLTYPE mul (__m128 a, __m128 b) noexcept { return _mm_mul_ps (a, b); }
  120. + static forcedinline __m128 JUCE_VECTOR_CALLTYPE div (__m128 a, __m128 b) noexcept { return _mm_div_ps (a, b); }
  121. static forcedinline __m128 JUCE_VECTOR_CALLTYPE bit_and (__m128 a, __m128 b) noexcept { return _mm_and_ps (a, b); }
  122. static forcedinline __m128 JUCE_VECTOR_CALLTYPE bit_or (__m128 a, __m128 b) noexcept { return _mm_or_ps (a, b); }
  123. static forcedinline __m128 JUCE_VECTOR_CALLTYPE bit_xor (__m128 a, __m128 b) noexcept { return _mm_xor_ps (a, b); }
  124. @@ -142,6 +143,7 @@ struct SIMDNativeOps<double>
  125. static forcedinline __m128d JUCE_VECTOR_CALLTYPE add (__m128d a, __m128d b) noexcept { return _mm_add_pd (a, b); }
  126. static forcedinline __m128d JUCE_VECTOR_CALLTYPE sub (__m128d a, __m128d b) noexcept { return _mm_sub_pd (a, b); }
  127. static forcedinline __m128d JUCE_VECTOR_CALLTYPE mul (__m128d a, __m128d b) noexcept { return _mm_mul_pd (a, b); }
  128. + static forcedinline __m128d JUCE_VECTOR_CALLTYPE div (__m128d a, __m128d b) noexcept { return _mm_div_pd (a, b); }
  129. static forcedinline __m128d JUCE_VECTOR_CALLTYPE bit_and (__m128d a, __m128d b) noexcept { return _mm_and_pd (a, b); }
  130. static forcedinline __m128d JUCE_VECTOR_CALLTYPE bit_or (__m128d a, __m128d b) noexcept { return _mm_or_pd (a, b); }
  131. static forcedinline __m128d JUCE_VECTOR_CALLTYPE bit_xor (__m128d a, __m128d b) noexcept { return _mm_xor_pd (a, b); }
  132. diff --git a/modules/juce_events/native/juce_mac_MessageManager.mm b/modules/juce_events/native/juce_mac_MessageManager.mm
  133. index 7a0718868..9d83519ff 100644
  134. --- a/modules/juce_events/native/juce_mac_MessageManager.mm
  135. +++ b/modules/juce_events/native/juce_mac_MessageManager.mm
  136. @@ -369,6 +369,7 @@ void MessageManager::runDispatchLoop()
  137. static void shutdownNSApp()
  138. {
  139. [NSApp stop: nil];
  140. + [NSEvent stopPeriodicEvents];
  141. [NSEvent startPeriodicEventsAfterDelay: 0 withPeriod: 0.1];
  142. }
  143. diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp
  144. index 1df2d6e20..e5c243eda 100644
  145. --- a/modules/juce_gui_basics/buttons/juce_Button.cpp
  146. +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp
  147. @@ -482,10 +482,7 @@ void Button::mouseDrag (const MouseEvent& e)
  148. bool Button::isMouseSourceOver (const MouseEvent& e)
  149. {
  150. - if (e.source.isTouch() || e.source.isPen())
  151. - return getLocalBounds().toFloat().contains (e.position);
  152. -
  153. - return isMouseOver();
  154. + return getLocalBounds().toFloat().contains (e.position);
  155. }
  156. void Button::focusGained (FocusChangeType)
  157. diff --git a/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp b/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp
  158. index 314544638..f3b61e2c3 100644
  159. --- a/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp
  160. +++ b/modules/juce_gui_basics/buttons/juce_ShapeButton.cpp
  161. @@ -76,9 +76,6 @@ void ShapeButton::setShape (const Path& newShape,
  162. shape = newShape;
  163. maintainShapeProportions = maintainShapeProportions_;
  164. - shadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 3, Point<int>()));
  165. - setComponentEffect (hasShadow ? &shadow : nullptr);
  166. -
  167. if (resizeNowToFitThisShape)
  168. {
  169. auto newBounds = shape.getBounds();
  170. diff --git a/modules/juce_gui_basics/buttons/juce_ShapeButton.h b/modules/juce_gui_basics/buttons/juce_ShapeButton.h
  171. index 6863b1cab..5f9cee9ee 100644
  172. --- a/modules/juce_gui_basics/buttons/juce_ShapeButton.h
  173. +++ b/modules/juce_gui_basics/buttons/juce_ShapeButton.h
  174. @@ -88,6 +88,8 @@ public:
  175. Colour overColourOn,
  176. Colour downColourOn);
  177. + void setShadowColour (Colour shadow) { shadowColour = shadow; }
  178. +
  179. /** Set whether the button should use the 'on' set of colours when its toggle state is 'on'.
  180. By default these will be the same as the normal colours but the setOnColours method can be
  181. used to provide a different set of colours.
  182. @@ -112,9 +114,8 @@ public:
  183. private:
  184. //==============================================================================
  185. Colour normalColour, overColour, downColour,
  186. - normalColourOn, overColourOn, downColourOn, outlineColour;
  187. + normalColourOn, overColourOn, downColourOn, outlineColour, shadowColour;
  188. bool useOnColours;
  189. - DropShadowEffect shadow;
  190. Path shape;
  191. BorderSize<int> border;
  192. bool maintainShapeProportions;
  193. diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp
  194. index fa8d3ccf5..b2d75c655 100644
  195. --- a/modules/juce_gui_basics/components/juce_Component.cpp
  196. +++ b/modules/juce_gui_basics/components/juce_Component.cpp
  197. @@ -3021,7 +3021,8 @@ void Component::modifierKeysChanged (const ModifierKeys& modifiers)
  198. void Component::internalModifierKeysChanged()
  199. {
  200. - sendFakeMouseMove();
  201. + auto mainMouse = Desktop::getInstance().getMainMouseSource();
  202. + mainMouse.triggerFakeMove();
  203. modifierKeysChanged (ModifierKeys::currentModifiers);
  204. }
  205. diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h
  206. index 3add1db6b..ca84bc80e 100644
  207. --- a/modules/juce_gui_basics/components/juce_Component.h
  208. +++ b/modules/juce_gui_basics/components/juce_Component.h
  209. @@ -439,7 +439,7 @@ public:
  210. @see setBounds, ComponentListener::componentMovedOrResized
  211. */
  212. - void setTopLeftPosition (Point<int> newTopLeftPosition);
  213. + virtual void setTopLeftPosition (Point<int> newTopLeftPosition);
  214. /** Moves the component to a new position.
  215. diff --git a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp
  216. index 7c6b83fbf..a84cf5a91 100644
  217. --- a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp
  218. +++ b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp
  219. @@ -43,14 +43,9 @@ void CaretComponent::paint (Graphics& g)
  220. g.fillRect (getLocalBounds());
  221. }
  222. -void CaretComponent::timerCallback()
  223. -{
  224. - setVisible (shouldBeShown() && ! isVisible());
  225. -}
  226. void CaretComponent::setCaretPosition (const Rectangle<int>& characterArea)
  227. {
  228. - startTimer (380);
  229. setVisible (shouldBeShown());
  230. setBounds (characterArea.withWidth (2));
  231. }
  232. diff --git a/modules/juce_gui_basics/keyboard/juce_CaretComponent.h b/modules/juce_gui_basics/keyboard/juce_CaretComponent.h
  233. index a10b26c69..97894c075 100644
  234. --- a/modules/juce_gui_basics/keyboard/juce_CaretComponent.h
  235. +++ b/modules/juce_gui_basics/keyboard/juce_CaretComponent.h
  236. @@ -31,8 +31,7 @@ namespace juce
  237. @tags{GUI}
  238. */
  239. -class JUCE_API CaretComponent : public Component,
  240. - private Timer
  241. +class JUCE_API CaretComponent : public Component
  242. {
  243. public:
  244. //==============================================================================
  245. @@ -73,7 +72,6 @@ private:
  246. Component* owner;
  247. bool shouldBeShown() const;
  248. - void timerCallback() override;
  249. JUCE_DECLARE_NON_COPYABLE (CaretComponent)
  250. };
  251. diff --git a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp
  252. index 9ea63b215..7e8f14993 100644
  253. --- a/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp
  254. +++ b/modules/juce_gui_basics/layout/juce_ComponentBoundsConstrainer.cpp
  255. @@ -271,23 +271,6 @@ void ComponentBoundsConstrainer::checkBounds (Rectangle<int>& bounds,
  256. bounds.setWidth (roundToInt (bounds.getHeight() * aspectRatio));
  257. }
  258. }
  259. -
  260. - if ((isStretchingTop || isStretchingBottom) && ! (isStretchingLeft || isStretchingRight))
  261. - {
  262. - bounds.setX (old.getX() + (old.getWidth() - bounds.getWidth()) / 2);
  263. - }
  264. - else if ((isStretchingLeft || isStretchingRight) && ! (isStretchingTop || isStretchingBottom))
  265. - {
  266. - bounds.setY (old.getY() + (old.getHeight() - bounds.getHeight()) / 2);
  267. - }
  268. - else
  269. - {
  270. - if (isStretchingLeft)
  271. - bounds.setX (old.getRight() - bounds.getWidth());
  272. -
  273. - if (isStretchingTop)
  274. - bounds.setY (old.getBottom() - bounds.getHeight());
  275. - }
  276. }
  277. jassert (! bounds.isEmpty());
  278. diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp
  279. index 738fed8c1..f9f79994c 100644
  280. --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp
  281. +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.cpp
  282. @@ -41,8 +41,6 @@ LookAndFeel_V1::LookAndFeel_V1()
  283. setColour (PopupMenu::highlightedBackgroundColourId, Colour (0xbfa4c2ce));
  284. setColour (PopupMenu::highlightedTextColourId, Colours::black);
  285. setColour (TextEditor::focusedOutlineColourId, findColour (TextButton::buttonColourId));
  286. -
  287. - scrollbarShadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 2, Point<int>()));
  288. }
  289. LookAndFeel_V1::~LookAndFeel_V1()
  290. @@ -291,7 +289,7 @@ void LookAndFeel_V1::drawScrollbar (Graphics& g, ScrollBar& bar,
  291. ImageEffectFilter* LookAndFeel_V1::getScrollbarEffect()
  292. {
  293. - return &scrollbarShadow;
  294. + return nullptr;
  295. }
  296. @@ -477,7 +475,7 @@ Button* LookAndFeel_V1::createSliderButton (Slider&, const bool isIncrement)
  297. ImageEffectFilter* LookAndFeel_V1::getSliderEffect (Slider&)
  298. {
  299. - return &scrollbarShadow;
  300. + return nullptr;
  301. }
  302. int LookAndFeel_V1::getSliderThumbRadius (Slider&)
  303. diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h
  304. index b6c05aed7..51508a57a 100644
  305. --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h
  306. +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V1.h
  307. @@ -97,8 +97,6 @@ public:
  308. bool positionTitleBarButtonsOnLeft) override;
  309. private:
  310. - DropShadowEffect scrollbarShadow;
  311. -
  312. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V1)
  313. };
  314. diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  315. index 21042d0b2..829fed8e6 100644
  316. --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  317. +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp
  318. @@ -1292,8 +1292,6 @@ void LookAndFeel_V4::drawCallOutBoxBackground (CallOutBox& box, Graphics& g,
  319. {
  320. cachedImage = { Image::ARGB, box.getWidth(), box.getHeight(), true };
  321. Graphics g2 (cachedImage);
  322. -
  323. - DropShadow (Colours::black.withAlpha (0.7f), 8, { 0, 2 }).drawForPath (g2, path);
  324. }
  325. g.setColour (Colours::black);
  326. diff --git a/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp b/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp
  327. index 7c0848644..2017bccb5 100644
  328. --- a/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp
  329. +++ b/modules/juce_gui_basics/misc/juce_BubbleComponent.cpp
  330. @@ -30,9 +30,6 @@ BubbleComponent::BubbleComponent()
  331. : allowablePlacements (above | below | left | right)
  332. {
  333. setInterceptsMouseClicks (false, false);
  334. -
  335. - shadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.35f), 5, Point<int>()));
  336. - setComponentEffect (&shadow);
  337. }
  338. BubbleComponent::~BubbleComponent() {}
  339. diff --git a/modules/juce_gui_basics/misc/juce_BubbleComponent.h b/modules/juce_gui_basics/misc/juce_BubbleComponent.h
  340. index f086c8ff3..cca6205a3 100644
  341. --- a/modules/juce_gui_basics/misc/juce_BubbleComponent.h
  342. +++ b/modules/juce_gui_basics/misc/juce_BubbleComponent.h
  343. @@ -178,7 +178,6 @@ private:
  344. Rectangle<int> content;
  345. Point<int> arrowTip;
  346. int allowablePlacements;
  347. - DropShadowEffect shadow;
  348. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BubbleComponent)
  349. };
  350. diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  351. index f18b890f4..e92e9af14 100644
  352. --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  353. +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  354. @@ -1816,7 +1816,7 @@ public:
  355. if (peerIsDeleted)
  356. return S_FALSE;
  357. - peer.handleDragExit (dragInfo);
  358. + peer.handleDragDrop (dragInfo);
  359. return S_OK;
  360. }
  361. diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp
  362. index 731193ff1..0f68f6efa 100644
  363. --- a/modules/juce_gui_basics/widgets/juce_Slider.cpp
  364. +++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp
  365. @@ -749,7 +749,7 @@ public:
  366. ? e.position.x - mouseDragStartPos.x
  367. : mouseDragStartPos.y - e.position.y;
  368. - newPos = owner.valueToProportionOfLength (valueOnMouseDown)
  369. + newPos = owner.valueToProportionOfLength (valueWhenLastDragged)
  370. + mouseDiff * (1.0 / pixelsForFullDragExtent);
  371. if (style == IncDecButtons)
  372. @@ -763,7 +763,7 @@ public:
  373. auto mouseDiff = (e.position.x - mouseDragStartPos.x)
  374. + (mouseDragStartPos.y - e.position.y);
  375. - newPos = owner.valueToProportionOfLength (valueOnMouseDown)
  376. + newPos = owner.valueToProportionOfLength (valueWhenLastDragged)
  377. + mouseDiff * (1.0 / pixelsForFullDragExtent);
  378. }
  379. else
  380. @@ -774,6 +774,7 @@ public:
  381. newPos = 1.0 - newPos;
  382. }
  383. + mouseDragStartPos = e.position;
  384. newPos = (isRotary() && ! rotaryParams.stopAtEnd) ? newPos - std::floor (newPos)
  385. : jlimit (0.0, 1.0, newPos);
  386. valueWhenLastDragged = owner.proportionOfLengthToValue (newPos);
  387. diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  388. index 233c23305..70afc33a1 100644
  389. --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  390. +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  391. @@ -833,6 +833,11 @@ struct TextEditor::TextHolderComponent : public Component,
  392. {
  393. owner.drawContent (g);
  394. }
  395. +
  396. + void setTopLeftPosition(Point<int> new_position) override {
  397. + Component::setTopLeftPosition(new_position);
  398. + owner.textChanged();
  399. + }
  400. void restartTimer()
  401. {
  402. @@ -1558,6 +1563,9 @@ void TextEditor::moveCaretTo (const int newPosition, const bool isSelecting)
  403. moveCaret (newPosition);
  404. selection = Range<int>::emptyRange (getCaretPosition());
  405. }
  406. +
  407. + if (listeners.size() != 0 || onTextChange != nullptr)
  408. + postCommandMessage (TextEditorDefs::textChangeMessageId);
  409. }
  410. int TextEditor::getTextIndexAt (const int x, const int y)
  411. @@ -2141,6 +2149,9 @@ void TextEditor::focusGained (FocusChangeType cause)
  412. repaint();
  413. updateCaretPosition();
  414. +
  415. + if (listeners.size() != 0 || onTextChange != nullptr)
  416. + postCommandMessage (TextEditorDefs::textChangeMessageId);
  417. }
  418. void TextEditor::focusLost (FocusChangeType)