Browse Source

Wait for X11 window to be created before returning from effEditOpen

This fixes the issues in Tracktion and possibly #170
tags/1.9.6
falkTX 10 years ago
parent
commit
083b56542d
2 changed files with 23 additions and 0 deletions
  1. +21
    -0
      source/backend/engine/CarlaEngineNative.cpp
  2. +2
    -0
      source/native-plugins/resources/carla-plugin

+ 21
- 0
source/backend/engine/CarlaEngineNative.cpp View File

@@ -64,6 +64,7 @@ class CarlaEngineNativeUI : public CarlaExternalUI
public:
CarlaEngineNativeUI(CarlaEngine* const engine)
: fEngine(engine),
fIsReady(false),
leakDetector_CarlaEngineNativeUI()
{
carla_debug("CarlaEngineNativeUI::CarlaEngineNativeUI(%p)", engine);
@@ -74,6 +75,11 @@ public:
carla_debug("CarlaEngineNativeUI::~CarlaEngineNativeUI()");
}

bool isReady() const noexcept
{
return fIsReady;
}

protected:
bool msgReceived(const char* const msg) noexcept override
{
@@ -531,6 +537,10 @@ protected:
if (CarlaPlugin* const plugin = fEngine->getPlugin(pluginId))
plugin->showCustomUI(yesNo);
}
else if (std::strcmp(msg, "ready") == 0)
{
fIsReady = true;
}
else
{
carla_stderr("CarlaEngineNativeUI::msgReceived : %s", msg);
@@ -550,6 +560,7 @@ protected:

private:
CarlaEngine* const fEngine;
bool fIsReady;

CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineNativeUI)
};
@@ -1484,6 +1495,16 @@ protected:

if (kIsPatchbay)
patchbayRefresh(false);

if (std::getenv("CARLA_PLUGIN_EMBED_WINID") != nullptr)
{
carla_stdout("Using Carla plugin embedded, waiting for it to be ready...");

for (; fUiServer.isPipeRunning() && ! fUiServer.isReady();)
fUiServer.idlePipe();

carla_stdout("Done!");
}
}
else
{


+ 2
- 0
source/native-plugins/resources/carla-plugin View File

@@ -423,6 +423,8 @@ if LINUX and not config_UseQt5:
self.embedInto(winId)
self.show()

gui.send(["ready"])

def addShortcutActions(self, actions):
for action in actions:
if not action.shortcut().isEmpty():


Loading…
Cancel
Save