mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Resize windows when needed
This commit is contained in:
@@ -45,7 +45,7 @@ HWND Editor::open() {
|
||||
CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_ACCEPTFILES,
|
||||
reinterpret_cast<LPCSTR>(window_class),
|
||||
"yabridge plugin", WS_POPUP, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, 256, 256, nullptr, nullptr,
|
||||
CW_USEDEFAULT, 2048, 2048, nullptr, nullptr,
|
||||
GetModuleHandle(nullptr), nullptr),
|
||||
&DestroyWindow);
|
||||
|
||||
|
||||
@@ -243,6 +243,17 @@ intptr_t PluginBridge::dispatch_wrapper(AEffect* plugin,
|
||||
return return_value;
|
||||
break;
|
||||
}
|
||||
case effEditGetRect: {
|
||||
const intptr_t return_value =
|
||||
plugin->dispatcher(plugin, opcode, index, value, data, option);
|
||||
|
||||
// Intercept these calls to make sure that the window (embedded
|
||||
// within the X11 window) is large enough.
|
||||
const auto size = **static_cast<VstRect**>(data);
|
||||
editor.resize(size);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
default:
|
||||
return plugin->dispatcher(plugin, opcode, index, value, data,
|
||||
option);
|
||||
@@ -293,10 +304,9 @@ class HostCallbackDataConverter : DefaultDataConverter {
|
||||
return AEffect(*plugin);
|
||||
break;
|
||||
case audioMasterSizeWindow:
|
||||
// TODO: Do all plugins send this? Or should we also use
|
||||
// effEditGetRect`or add hooks int oresize events.
|
||||
// The plugin sends it's own width and hieght in the index and
|
||||
// value parameters
|
||||
// TODO: Does the plugin not do this automatically? Check Some
|
||||
// plugins will the host that their size has changed, so
|
||||
// we'll have to change the window for it.
|
||||
editor.resize(VstRect{0, 0, static_cast<short>(value),
|
||||
static_cast<short>(index)});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user