From f980758afb6f614119c8c228f3c0d993d8144657 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 20 Apr 2024 09:38:55 +0200 Subject: [PATCH] Pass backend embed UI resizes through NATIVE_HOST_OPCODE_UI_RESIZE Signed-off-by: falkTX --- source/backend/engine/CarlaEngineNative.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 2547bb6ee..249eff411 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -351,6 +351,14 @@ public: pHost->ui_closed(pHost->handle); break; + case ENGINE_CALLBACK_EMBED_UI_RESIZED: + if (sendHost && fUsesEmbed) + pHost->dispatcher(pHost->handle, + NATIVE_HOST_OPCODE_UI_RESIZE, + value1, value2, + nullptr, 0.0f); + break; + default: break; } @@ -1391,11 +1399,13 @@ protected: if (carla_isNotEqual(fLastScaleFactor, pData->options.uiScale)) { fLastScaleFactor = pData->options.uiScale; - pHost->dispatcher(pHost->handle, - NATIVE_HOST_OPCODE_UI_RESIZE, - static_cast(kUiWidth * fLastScaleFactor + 0.5f), - static_cast(kUiHeight * fLastScaleFactor + 0.5f), - nullptr, 0.0f); + + if (! fUsesEmbed) + pHost->dispatcher(pHost->handle, + NATIVE_HOST_OPCODE_UI_RESIZE, + static_cast(kUiWidth * fLastScaleFactor + 0.5f), + static_cast(kUiHeight * fLastScaleFactor + 0.5f), + nullptr, 0.0f); } {