From e329f524a23f0440380f25aad1498484ebb409c5 Mon Sep 17 00:00:00 2001 From: attila Date: Mon, 20 Dec 2021 21:46:55 +0100 Subject: [PATCH] StandaloneFilterWindow: Take native window borders into account when constraining size --- .../Standalone/juce_StandaloneFilterWindow.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index 85ebc27d42..58b458da9f 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -979,8 +979,17 @@ private: if (auto* editorConstrainer = editor->getConstrainer()) { const auto borders = owner.getContentComponentBorder(); - const auto extraWindowWidth = borders.getLeftAndRight(); - const auto extraWindowHeight = extraHeight + borders.getTopAndBottom(); + + const auto windowBorders = [&]() -> BorderSize + { + if (auto* peer = owner.getPeer()) + return peer->getFrameSize(); + + return {}; + }(); + + const auto extraWindowWidth = borders.getLeftAndRight() + windowBorders.getLeftAndRight(); + const auto extraWindowHeight = extraHeight + borders.getTopAndBottom() + windowBorders.getTopAndBottom(); owner.setResizeLimits (jmax (10, editorConstrainer->getMinimumWidth() + extraWindowWidth), jmax (10, editorConstrainer->getMinimumHeight() + extraWindowHeight),