From e2c19ef2cc0c5eca7a1095ef528d72007f9e412e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kokosi=C5=84ski?= Date: Mon, 12 Oct 2026 17:57:47 +0200 Subject: [PATCH] Fix minimum size being scaled twice in Window::setSize Since d4c2ce6e the minimum size of an embed window is read back from pugl's size hint, which enableInternalScalingWithSize() (and the deprecated setGeometryConstraints overload) already stored multiplied by the scale factor. setSize() then multiplied it by the scale factor again, so the effective minimum became base size times scale squared. With internal scaling enabled for a 380x750 UI at scale factor 1.8, any setSize() call ended up at 1231x2430 instead of at least 684x1350. The host-side constraint checks (VST3 checkSizeConstraint, CLAP get_resize_hints) already use the hint as-is, so only setSize() was out of line. --- dgl/src/Window.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp index e616b5128..7b46aa71e 100644 --- a/dgl/src/Window.cpp +++ b/dgl/src/Window.cpp @@ -274,12 +274,11 @@ void Window::setSize(uint width, uint height) if (pData->isEmbed) { - PuglArea area = puglGetSizeHint(pData->view, PUGL_FIXED_ASPECT); + // already scaled, as stored by enableInternalScalingWithSize() + const PuglArea area = puglGetSizeHint(pData->view, PUGL_FIXED_ASPECT); if (pData->autoScaling && d_isNotEqual(scaleFactor, 1.0)) { - area.width = d_roundToUnsignedInt(area.width * scaleFactor); - area.height = d_roundToUnsignedInt(area.height * scaleFactor); width = d_roundToUnsignedInt(width * scaleFactor); height = d_roundToUnsignedInt(height * scaleFactor); }