diff --git a/source/backend/engine/CarlaEngineBridge.cpp b/source/backend/engine/CarlaEngineBridge.cpp index b88c5ddd0..2515f9291 100644 --- a/source/backend/engine/CarlaEngineBridge.cpp +++ b/source/backend/engine/CarlaEngineBridge.cpp @@ -711,6 +711,18 @@ public: } break; + case ENGINE_CALLBACK_EMBED_UI_RESIZED: { + CARLA_SAFE_ASSERT_BREAK(value1 > 1); + CARLA_SAFE_ASSERT_BREAK(value2 > 1); + + const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); + + fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerResizeEmbedUI); + fShmNonRtServerControl.writeUInt(static_cast(value1)); + fShmNonRtServerControl.writeUInt(static_cast(value2)); + fShmNonRtServerControl.commitWrite(); + } break; + case ENGINE_CALLBACK_RELOAD_PARAMETERS: if (const CarlaPluginPtr plugin = pData->plugins[0].plugin) { @@ -1108,7 +1120,7 @@ public: const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); - fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerEmbedUI); + fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerRespEmbedUI); fShmNonRtServerControl.writeULong(reinterpret_cast(resp)); fShmNonRtServerControl.commitWrite(); break; diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index c29d18b02..4e1667458 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -2132,8 +2132,12 @@ public: pData->hints = hints | PLUGIN_IS_BRIDGE; pData->options = optionEn; + #ifdef HAVE_X11 if (fBridgeVersion < 9) + #endif + { pData->hints &= ~PLUGIN_HAS_CUSTOM_EMBED_UI; + } fInfo.category = static_cast(category); fInfo.optionsAvailable = optionAv; @@ -2562,15 +2566,23 @@ public: fSaved = true; break; - case kPluginBridgeNonRtServerEmbedUI: + case kPluginBridgeNonRtServerRespEmbedUI: fPendingEmbedCustomUI = fShmNonRtServerControl.readULong(); break; + case kPluginBridgeNonRtServerResizeEmbedUI: { + const uint width = fShmNonRtServerControl.readUInt(); + const uint height = fShmNonRtServerControl.readUInt(); + pData->engine->callback(true, true, ENGINE_CALLBACK_EMBED_UI_RESIZED, pData->id, width, height, + 0, 0.0f, nullptr); + } break; + case kPluginBridgeNonRtServerUiClosed: #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH pData->transientTryCounter = 0; #endif - pData->engine->callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); + pData->engine->callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, + 0, 0, 0, 0.0f, nullptr); break; case kPluginBridgeNonRtServerError: { diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index 01562b381..5a18c38e5 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -1533,7 +1533,8 @@ public: case kPluginBridgeNonRtServerMidiProgramData: case kPluginBridgeNonRtServerSetCustomData: case kPluginBridgeNonRtServerVersion: - case kPluginBridgeNonRtServerEmbedUI: + case kPluginBridgeNonRtServerRespEmbedUI: + case kPluginBridgeNonRtServerResizeEmbedUI: break; case kPluginBridgeNonRtServerSetChunkDataFile: diff --git a/source/utils/CarlaBridgeDefines.hpp b/source/utils/CarlaBridgeDefines.hpp index f83e5c668..27265e133 100644 --- a/source/utils/CarlaBridgeDefines.hpp +++ b/source/utils/CarlaBridgeDefines.hpp @@ -118,7 +118,8 @@ enum PluginBridgeNonRtServerOpcode { // stuff added in API 7 kPluginBridgeNonRtServerVersion, // uint // stuff added in API 9 - kPluginBridgeNonRtServerEmbedUI, // ulong + kPluginBridgeNonRtServerRespEmbedUI, // ulong + kPluginBridgeNonRtServerResizeEmbedUI, // uint/width, uint/height }; // used for kPluginBridgeNonRtServerPortName diff --git a/source/utils/CarlaBridgeUtils.hpp b/source/utils/CarlaBridgeUtils.hpp index 3ef6de902..72668c878 100644 --- a/source/utils/CarlaBridgeUtils.hpp +++ b/source/utils/CarlaBridgeUtils.hpp @@ -202,8 +202,10 @@ const char* PluginBridgeNonRtServerOpcode2str(const PluginBridgeNonRtServerOpcod return "kPluginBridgeNonRtServerError"; case kPluginBridgeNonRtServerVersion: return "kPluginBridgeNonRtServerVersion"; - case kPluginBridgeNonRtServerEmbedUI: - return "kPluginBridgeNonRtServerEmbedUI"; + case kPluginBridgeNonRtServerRespEmbedUI: + return "kPluginBridgeNonRtServerRespEmbedUI"; + case kPluginBridgeNonRtServerResizeEmbedUI: + return "kPluginBridgeNonRtServerResizeEmbedUI"; } carla_stderr("CarlaBackend::PluginBridgeNonRtServerOpcode2str%i) - invalid opcode", opcode);