From 6501bf3f2f41ad3a0e1cced1ac174cebe7e3131f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 14 Feb 2015 18:49:16 +0000 Subject: [PATCH] Hide custom UIs when closing carla-plugin --- source/backend/engine/CarlaEngineNative.cpp | 16 ++++++++++++++++ source/carla_host.py | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 8ac9f610d..fd44a38f7 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -1509,6 +1509,22 @@ protected: else { fUiServer.stopPipeServer(5000); + + // hide all custom uis + for (uint i=0; i < pData->curPluginCount; ++i) + { + CarlaPlugin* const plugin(pData->plugins[i].plugin); + + if (plugin != nullptr && plugin->isEnabled()) + { + if (plugin->getHints() & PLUGIN_HAS_CUSTOM_UI) + { + try { + plugin->showCustomUI(false); + } CARLA_SAFE_EXCEPTION_CONTINUE("Plugin showCustomUI (hide)"); + } + } + } } } diff --git a/source/carla_host.py b/source/carla_host.py index a4a2de2b5..908b28c3a 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -1788,13 +1788,13 @@ class HostWindow(QMainWindow): QMainWindow.showEvent(self, event) # set our gui as parent for all plugins UIs - if self.fParentOrSelf == self: + if not self.host.isPlugin: winIdStr = "%x" % self.winId() self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr) def hideEvent(self, event): # disable parent - if self.fParentOrSelf == self: + if not self.host.isPlugin: self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, "0") QMainWindow.hideEvent(self, event)