Browse Source

Make the mousemove behaviour of OS X plug-ins the same as their Windows counterparts

tags/2021-05-28
tpoole 9 years ago
parent
commit
08b2116c2b
4 changed files with 12 additions and 4 deletions
  1. +4
    -0
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  2. +1
    -1
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
  3. +4
    -0
      modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  4. +3
    -3
      modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h

+ 4
- 0
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -1180,6 +1180,8 @@ public:
#else
setWantsKeyboardFocus (true);
#endif
ignoreUnused (fakeMouseGenerator);
}
~EditorCompHolder()
@@ -1259,6 +1261,8 @@ public:
}
private:
FakeMouseMoveGenerator fakeMouseGenerator;
JUCE_DECLARE_NON_COPYABLE (EditorCompHolder)
};


+ 1
- 1
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp View File

@@ -1576,7 +1576,7 @@ public:
addMouseListener (this, true);
#endif
ignoreUnused (fakeMouseGenerator);
ignoreUnused (fakeMouseGenerator);
}
~EditorCompWrapper()


+ 4
- 0
modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -40,6 +40,7 @@
#include "../utility/juce_IncludeModuleHeaders.h"
#include "../utility/juce_WindowsHooks.h"
#include "../utility/juce_PluginBusUtilities.h"
#include "../utility/juce_FakeMouseMoveGenerator.h"
#include "../../juce_audio_processors/format_types/juce_VST3Common.h"
#ifndef JUCE_VST3_CAN_REPLACE_VST2
@@ -849,6 +850,8 @@ private:
setBounds (pluginEditor->getLocalBounds());
resizeHostWindow();
}
ignoreUnused (fakeMouseGenerator);
}
~ContentWrapperComponent()
@@ -910,6 +913,7 @@ private:
private:
JuceVST3Editor& owner;
FakeMouseMoveGenerator fakeMouseGenerator;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ContentWrapperComponent)
};


+ 3
- 3
modules/juce_audio_plugin_client/utility/juce_FakeMouseMoveGenerator.h View File

@@ -25,10 +25,10 @@
#ifndef JUCE_FAKEMOUSEMOVEGENERATOR_H_INCLUDED
#define JUCE_FAKEMOUSEMOVEGENERATOR_H_INCLUDED
#if JUCE_MAC && JUCE_SUPPORT_CARBON
#if JUCE_MAC
//==============================================================================
// Helper class to workaround carbon windows not getting mouse-moves..
// Helper class to workaround windows not getting mouse-moves...
class FakeMouseMoveGenerator : private Timer
{
public:
@@ -39,7 +39,7 @@ public:
void timerCallback() override
{
// workaround for carbon windows not getting mouse-moves..
// Workaround for windows not getting mouse-moves...
const Point<float> screenPos (Desktop::getInstance().getMainMouseSource().getScreenPosition());
if (screenPos != lastScreenPos)


Loading…
Cancel
Save