Skip to content

Commit

Permalink
Pass backend embed UI resizes through NATIVE_HOST_OPCODE_UI_RESIZE
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Apr 20, 2024
1 parent 0032f18 commit f980758
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions source/backend/engine/CarlaEngineNative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ class CarlaEngineNative : public CarlaEngine
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;
}
Expand Down Expand Up @@ -1391,11 +1399,13 @@ class CarlaEngineNative : public CarlaEngine
if (carla_isNotEqual(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);
}

{
Expand Down

0 comments on commit f980758

Please sign in to comment.