| 556 | } |
| 557 | |
| 558 | void widgetCreated() |
| 559 | { |
| 560 | if (module == nullptr || module->pcontext == nullptr || module->fCarlaHostHandle == nullptr) |
| 561 | return; |
| 562 | |
| 563 | const CarlaHostHandle handle = module->fCarlaHostHandle; |
| 564 | const CardinalPluginContext* const pcontext = module->pcontext; |
| 565 | |
| 566 | char winIdStr[24]; |
| 567 | std::snprintf(winIdStr, sizeof(winIdStr), "%llx", (ulonglong)pcontext->nativeWindowId); |
| 568 | |
| 569 | module->fCarlaHostDescriptor.uiParentId = pcontext->nativeWindowId; |
| 570 | carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr); |
| 571 | |
| 572 | if (pcontext->window != nullptr) |
| 573 | carla_set_engine_option(handle, ENGINE_OPTION_FRONTEND_UI_SCALE, pcontext->window->pixelRatio*1000, nullptr); |
| 574 | |
| 575 | if (! idleCallbackActive) |
| 576 | idleCallbackActive = pcontext->addIdleCallback(this); |
| 577 | |
| 578 | module->fUI = this; |
| 579 | } |
| 580 | |
| 581 | void widgetDestroyed() |
| 582 | { |
nothing calls this directly
no test coverage detected