Browse Source

Fix crash with old linux vsts; Don't use magic on bridge builds

tags/1.9.4
falkTX 10 years ago
parent
commit
8d4462a322
5 changed files with 25 additions and 10 deletions
  1. +1
    -1
      Makefile
  2. +5
    -0
      source/backend/plugin/CarlaPluginUi.cpp
  3. +3
    -0
      source/backend/plugin/CarlaPluginUi.hpp
  4. +13
    -6
      source/backend/plugin/VstPlugin.cpp
  5. +3
    -3
      source/utils/CarlaBinaryUtils.hpp

+ 1
- 1
Makefile View File

@@ -542,7 +542,7 @@ ANS_YES=" YES "
endif

features:
@echo "$(tS)---> Engine driver $(tE)"
@echo "$(tS)---> Engine drivers $(tE)"
@echo "JACK: $(ANS_YES)"
ifeq ($(LINUX),true)
ifeq ($(HAVE_ALSA),true)


+ 5
- 0
source/backend/plugin/CarlaPluginUi.cpp View File

@@ -214,6 +214,11 @@ public:
return (void*)fWindow;
}

void* getDisplay() const noexcept
{
return fDisplay;
}

private:
Display* fDisplay;
Window fWindow;


+ 3
- 0
source/backend/plugin/CarlaPluginUi.hpp View File

@@ -40,6 +40,9 @@ public:
virtual void setTitle(const char* const title) = 0;
virtual void setTransientWinId(const uintptr_t winId) = 0;
virtual void* getPtr() const noexcept = 0;
#ifdef HAVE_X11
virtual void* getDisplay() const noexcept = 0;
#endif

static bool tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId);



+ 13
- 6
source/backend/plugin/VstPlugin.cpp View File

@@ -426,7 +426,9 @@ public:
CarlaString uiTitle(pData->name);
uiTitle += " (GUI)";

void* vstPtr;
intptr_t value = 0;
void* vstPtr = nullptr;
ERect* vstRect = nullptr;

if (fUi.window == nullptr && fUi.type == UI::UI_EMBED)
{
@@ -460,17 +462,22 @@ public:
else
vstPtr = const_cast<char*>(uiTitle.buffer());

if (dispatcher(effEditOpen, 0, 0, vstPtr, 0.0f) != 0)
dispatcher(effEditGetRect, 0, 0, &vstRect, 0.0f);

#ifdef HAVE_X11
value = (intptr_t)fUi.window->getDisplay();
#endif

if (dispatcher(effEditOpen, 0, value, vstPtr, 0.0f) != 0)
{
if (fUi.type == UI::UI_EMBED)
{
ERect* vstRect = nullptr;

dispatcher(effEditGetRect, 0, 0, &vstRect, 0.0f);
if (vstRect == nullptr || vstRect->right - vstRect->left < 2)
dispatcher(effEditGetRect, 0, 0, &vstRect, 0.0f);

if (vstRect != nullptr)
{
const int width(vstRect->right - vstRect->left);
const int width(vstRect->right - vstRect->left);
const int height(vstRect->bottom - vstRect->top);

CARLA_SAFE_ASSERT_INT2(width > 1 && height > 1, width, height);


+ 3
- 3
source/utils/CarlaBinaryUtils.hpp View File

@@ -21,13 +21,13 @@
#include "CarlaBackend.h"
#include "CarlaUtils.hpp"

#ifdef CARLA_OS_LINUX
#if defined(CARLA_OS_LINUX) && ! defined(BUILD_BRIDGE)
# include "magic.h"
#endif

CARLA_BACKEND_START_NAMESPACE

#ifdef CARLA_OS_LINUX
#if defined(CARLA_OS_LINUX) && ! defined(BUILD_BRIDGE)
// -----------------------------------------------------------------------

class CarlaMagic
@@ -72,7 +72,7 @@ BinaryType getBinaryTypeFromFile(const char* const filename)
{
carla_stdout("getBinaryTypeFromFile(\"%s\")", filename);

#ifdef CARLA_OS_LINUX
#if defined(CARLA_OS_LINUX) && ! defined(BUILD_BRIDGE)
if (filename == nullptr || filename[0] == '\0')
return BINARY_NATIVE;



Loading…
Cancel
Save