Browse Source

Make forced center ui optional (will be needed later)

tags/1.9.4
falkTX 10 years ago
parent
commit
44e2741d1e
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      source/backend/plugin/CarlaPlugin.cpp
  2. +2
    -2
      source/utils/CarlaPluginUI.cpp
  3. +1
    -1
      source/utils/CarlaPluginUI.hpp

+ 1
- 1
source/backend/plugin/CarlaPlugin.cpp View File

@@ -1323,7 +1323,7 @@ void CarlaPlugin::idle()
CarlaString uiTitle(pData->name);
uiTitle += " (GUI)";

if (CarlaPluginUI::tryTransientWinIdMatch(pData->osc.data.target != nullptr ? pData->osc.thread.getPid() : 0, uiTitle, pData->engine->getOptions().frontendWinId))
if (CarlaPluginUI::tryTransientWinIdMatch(pData->osc.data.target != nullptr ? pData->osc.thread.getPid() : 0, uiTitle, pData->engine->getOptions().frontendWinId, true))
pData->transientTryCounter = 0;
}



+ 2
- 2
source/utils/CarlaPluginUI.cpp View File

@@ -298,7 +298,7 @@ private:

// -----------------------------------------------------

bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId)
bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI)
{
CARLA_SAFE_ASSERT_RETURN(uiTitle != nullptr && uiTitle[0] != '\0', true);
CARLA_SAFE_ASSERT_RETURN(winId != 0, true);
@@ -446,7 +446,7 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons

XSetTransientForHint(sd.display, lastGoodWindow, hostWinId);

// center the plugin UI
if (centerUI)
{
int hostX, hostY, pluginX, pluginY;
uint hostWidth, hostHeight, pluginWidth, pluginHeight, border, depth;


+ 1
- 1
source/utils/CarlaPluginUI.hpp View File

@@ -44,7 +44,7 @@ public:
virtual void* getDisplay() const noexcept = 0;
#endif

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

#ifdef CARLA_OS_MAC
static CarlaPluginUI* newCocoa(CloseCallback*, uintptr_t);


Loading…
Cancel
Save