Browse Source

Fix resize recursion when triggered via host

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.06
falkTX 1 week ago
parent
commit
7860e6e539
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 7 additions and 1 deletions
  1. +2
    -1
      src/CardinalUI.cpp
  2. +5
    -0
      src/override/Window.cpp

+ 2
- 1
src/CardinalUI.cpp View File

@@ -46,6 +46,7 @@ namespace app {
namespace window {
void WindowSetPluginUI(Window* window, DISTRHO_NAMESPACE::UI* ui);
void WindowSetMods(Window* window, int mods);
void WindowSetInternalSize(rack::window::Window* window, math::Vec size);
}
}

@@ -610,7 +611,7 @@ protected:
UI::onResize(ev);

if (context->window != nullptr)
context->window->setSize(rack::math::Vec(ev.size.getWidth(), ev.size.getHeight()));
WindowSetInternalSize(context->window, rack::math::Vec(ev.size.getWidth(), ev.size.getHeight()));

const double scaleFactor = getScaleFactor();
char sizeString[64];


+ 5
- 0
src/override/Window.cpp View File

@@ -355,6 +355,11 @@ void Window::setSize(math::Vec size) {
ui->setSize(internal->size.x, internal->size.y);
}

void WindowSetInternalSize(rack::window::Window* const window, math::Vec size) {
size = size.max(WINDOW_SIZE_MIN);
window->internal->size = size;
}


void Window::run() {
internal->frame = 0;


Loading…
Cancel
Save