diff --git a/CMakeLists.txt b/CMakeLists.txt index 47500e2b1..bdcece944 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,9 @@ set(JUCE_COMPILE_DEFINITIONS JUCE_USE_COREIMAGE_LOADER=0 JUCE_SILENCE_XCODE_15_LINKER_WARNING=1 JUCE_USE_XRENDER=1 + JUCE_ALSA=1 + JUCE_JACK=1 + JUCE_JACK_CLIENT_NAME="plugdata" ) set(PLUGDATA_COMPILE_DEFINITIONS diff --git a/Source/Components/ZoomableDragAndDropContainer.cpp b/Source/Components/ZoomableDragAndDropContainer.cpp index 624a97735..7135a7e5e 100644 --- a/Source/Components/ZoomableDragAndDropContainer.cpp +++ b/Source/Components/ZoomableDragAndDropContainer.cpp @@ -619,6 +619,7 @@ void ZoomableDragAndDropContainer::startDragging(var const& sourceDescription, #endif dragOperationStarted(dragImageComponent->sourceDetails); + TopLevelWindow::getActiveTopLevelWindow()->repaint(); } bool ZoomableDragAndDropContainer::isDragAndDropActive() const diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 8dae53055..e9d96f2f9 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -322,7 +322,7 @@ void PluginEditor::paint(Graphics& g) { auto baseColour = findColour(PlugDataColour::toolbarBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + if (ProjectInfo::isStandalone && !isActiveWindow()) { baseColour = baseColour.brighter(baseColour.getBrightness() / 2.5f); } @@ -618,7 +618,8 @@ void PluginEditor::createNewWindow(TabBarButtonComponent* tabButton) bool PluginEditor::isActiveWindow() { - return !ProjectInfo::isStandalone || (TopLevelWindow::getActiveTopLevelWindow() == getTopLevelComponent()); + bool isDraggingTab = ZoomableDragAndDropContainer::isDragAndDropActive(); + return !ProjectInfo::isStandalone || isDraggingTab || (TopLevelWindow::getActiveTopLevelWindow() == getTopLevelComponent()); } void PluginEditor::newProject() diff --git a/Source/Sidebar/Palettes.h b/Source/Sidebar/Palettes.h index 23e5d6a69..e9bb6bfb0 100644 --- a/Source/Sidebar/Palettes.h +++ b/Source/Sidebar/Palettes.h @@ -281,7 +281,7 @@ class PaletteDraggableList : public Component class PaletteComponent : public Component { public: PaletteComponent(PluginEditor* e, ValueTree tree) - : paletteTree(tree) + : editor(e), paletteTree(tree) { paletteDraggableList = new PaletteDraggableList(e, tree); @@ -327,7 +327,7 @@ class PaletteComponent : public Component { { // toolbar bar auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + if (ProjectInfo::isStandalone && !editor->isActiveWindow()) { backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f); } @@ -354,6 +354,7 @@ class PaletteComponent : public Component { private: PaletteDraggableList* paletteDraggableList; ValueTree paletteTree; + PluginEditor* editor; BouncingViewport viewport; Label nameLabel; @@ -389,7 +390,8 @@ class PaletteSelector : public TextButton { void paint(Graphics& g) override { auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + auto* editor = findParentComponentOfClass(); + if (ProjectInfo::isStandalone && editor && !editor->isActiveWindow()) { backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f); } @@ -700,7 +702,7 @@ class Palettes : public Component } auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + if (ProjectInfo::isStandalone && !editor->isActiveWindow()) { backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f); } g.setColour(backgroundColour); diff --git a/Source/Sidebar/Sidebar.cpp b/Source/Sidebar/Sidebar.cpp index 98da0f182..9cd56cf3a 100644 --- a/Source/Sidebar/Sidebar.cpp +++ b/Source/Sidebar/Sidebar.cpp @@ -112,7 +112,7 @@ void Sidebar::paint(Graphics& g) g.fillRect(0, 30, getWidth(), getHeight()); auto toolbarColour = findColour(PlugDataColour::toolbarBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + if (ProjectInfo::isStandalone && !editor->isActiveWindow()) { toolbarColour = toolbarColour.brighter(toolbarColour.getBrightness() / 2.5f); } diff --git a/Source/Tabbar/Tabbar.cpp b/Source/Tabbar/Tabbar.cpp index f6b6ae69f..7c092aa9a 100644 --- a/Source/Tabbar/Tabbar.cpp +++ b/Source/Tabbar/Tabbar.cpp @@ -639,7 +639,7 @@ void TabComponent::paint(Graphics& g) { auto backgroundColour = findColour(PlugDataColour::tabBackgroundColourId); - if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) { + if (ProjectInfo::isStandalone && !editor->isActiveWindow()) { backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f); }