Browse Source

Pass backend embed UI resizes through NATIVE_HOST_OPCODE_UI_RESIZE

Signed-off-by: falkTX <falktx@falktx.com>
pull/1898/head
falkTX 6 months ago
parent
commit
f980758afb
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 15 additions and 5 deletions
  1. +15
    -5
      source/backend/engine/CarlaEngineNative.cpp

+ 15
- 5
source/backend/engine/CarlaEngineNative.cpp View File

@@ -351,6 +351,14 @@ public:
pHost->ui_closed(pHost->handle); pHost->ui_closed(pHost->handle);
break; 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: default:
break; break;
} }
@@ -1391,11 +1399,13 @@ protected:
if (carla_isNotEqual(fLastScaleFactor, pData->options.uiScale)) if (carla_isNotEqual(fLastScaleFactor, pData->options.uiScale))
{ {
fLastScaleFactor = pData->options.uiScale; fLastScaleFactor = pData->options.uiScale;
pHost->dispatcher(pHost->handle,
NATIVE_HOST_OPCODE_UI_RESIZE,
static_cast<int>(kUiWidth * fLastScaleFactor + 0.5f),
static_cast<int>(kUiHeight * fLastScaleFactor + 0.5f),
nullptr, 0.0f);

if (! fUsesEmbed)
pHost->dispatcher(pHost->handle,
NATIVE_HOST_OPCODE_UI_RESIZE,
static_cast<int>(kUiWidth * fLastScaleFactor + 0.5f),
static_cast<int>(kUiHeight * fLastScaleFactor + 0.5f),
nullptr, 0.0f);
} }


{ {


Loading…
Cancel
Save