Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
timothyschoen committed Nov 10, 2023
2 parents b1184c3 + 346978c commit 2da2f63
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS YES)

project(plugdata VERSION 0.8.1 LANGUAGES C CXX)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
message(STATUS "Disabled sfizz")
set(ENABLE_SFIZZ OFF)
endif()

add_subdirectory(Libraries/ EXCLUDE_FROM_ALL)

cmake_policy(SET CMP0091 NEW)
Expand Down
3 changes: 3 additions & 0 deletions Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ PluginEditor::PluginEditor(PluginProcessor& p)
// NEVER touch pluginConstrainer outside of plugin mode!
pluginConstrainer.setMinimumSize(850, 650);
setUseBorderResizer(true);
#if JUCE_LINUX
OSUtils::updateX11Constraints(getPeer()->getNativeHandle());
#endif
}
else {
constrainer.setMinimumSize(850, 650);
Expand Down
10 changes: 10 additions & 0 deletions Source/PluginMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class PluginMode : public Component {
editor->pluginConstrainer.setSizeLimits(newWidth, newHeight, newWidth, newHeight);
}

#if JUCE_LINUX
OSUtils::updateX11Constraints(getPeer()->getNativeHandle());
#endif
editor->setSize(newWidth, newHeight);
setBounds(0, 0, newWidth, newHeight);
}
Expand All @@ -155,10 +158,17 @@ class PluginMode : public Component {
mainWindow->setUsingNativeTitleBar(true);
}
editor->constrainer.setSizeLimits(850, 650, 99000, 99000);
#if JUCE_LINUX
OSUtils::updateX11Constraints(getPeer()->getNativeHandle());
#endif

auto correctedPosition = windowBounds.getTopLeft() - Point<int>(0, nativeTitleBarHeight);
mainWindow->setBoundsConstrained(windowBounds.withPosition(correctedPosition));
} else {
editor->pluginConstrainer.setSizeLimits(850, 650, 99000, 99000);
#if JUCE_LINUX
OSUtils::updateX11Constraints(getPeer()->getNativeHandle());
#endif
editor->setBounds(windowBounds);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Statusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ class CPUMeter : public Component
void cpuUsageChanged(float newCpuUsage) override
{
CriticalSection::ScopedLockType lock(cpuMeterMutex);
cpuUsage.add(newCpuUsage);
cpuUsage.add(newCpuUsage); // FIXME: we should use a circular buffer instead
cpuUsage.remove(0);
updateCPUGraph();
}
Expand Down
8 changes: 8 additions & 0 deletions Source/Utility/OSUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1
#include <juce_gui_basics/juce_gui_basics.h>


#include "OSUtils.h"

#if defined(__APPLE__)
Expand Down Expand Up @@ -165,6 +167,12 @@ OSUtils::KeyboardLayout OSUtils::getKeyboardLayout()
// Selects Linux and BSD
#if defined(__unix__) && !defined(__APPLE__)


void OSUtils::updateX11Constraints(void* handle)
{
juce::XWindowSystem::getInstance()->updateConstraints(reinterpret_cast<::Window>(handle));
}

bool OSUtils::isX11WindowMaximised(void* handle)
{
enum window_state_t {
Expand Down
1 change: 1 addition & 0 deletions Source/Utility/OSUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct OSUtils {
#elif defined(__unix__) && !defined(__APPLE__)
static void maximiseX11Window(void* handle, bool shouldBeMaximised);
static bool isX11WindowMaximised(void* handle);
static void updateX11Constraints(void* handle);
#elif JUCE_MAC
static void enableInsetTitlebarButtons(void* nativeHandle, bool enabled);
static void HideTitlebarButtons(void* view, bool hideMinimiseButton, bool hideMaximiseButton, bool hideCloseButton);
Expand Down

0 comments on commit 2da2f63

Please sign in to comment.