mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Don't serialize input size for IPlugView::GetSize
This commit is contained in:
@@ -1571,10 +1571,10 @@ void Vst3Logger::log_response(bool is_host_vst,
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
message << response.result.string();
|
||||
if (response.result == Steinberg::kResultOk) {
|
||||
message << ", <ViewRect* with left = " << response.updated_size.left
|
||||
<< ", top = " << response.updated_size.top
|
||||
<< ", right = " << response.updated_size.right
|
||||
<< ", bottom = " << response.updated_size.bottom << ">";
|
||||
message << ", <ViewRect* with left = " << response.size.left
|
||||
<< ", top = " << response.size.top
|
||||
<< ", right = " << response.size.right
|
||||
<< ", bottom = " << response.size.bottom << ">";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -210,12 +210,12 @@ class YaPlugView : public Steinberg::IPlugView {
|
||||
*/
|
||||
struct GetSizeResponse {
|
||||
UniversalTResult result;
|
||||
Steinberg::ViewRect updated_size;
|
||||
Steinberg::ViewRect size;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.object(result);
|
||||
s.object(updated_size);
|
||||
s.object(size);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -227,12 +227,9 @@ class YaPlugView : public Steinberg::IPlugView {
|
||||
|
||||
native_size_t owner_instance_id;
|
||||
|
||||
Steinberg::ViewRect size;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(owner_instance_id);
|
||||
s.object(size);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -168,11 +168,10 @@ tresult PLUGIN_API Vst3PlugViewProxyImpl::onKeyUp(char16 key,
|
||||
|
||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::getSize(Steinberg::ViewRect* size) {
|
||||
if (size) {
|
||||
const GetSizeResponse response =
|
||||
send_mutually_recursive_message(YaPlugView::GetSize{
|
||||
.owner_instance_id = owner_instance_id(), .size = *size});
|
||||
const GetSizeResponse response = send_mutually_recursive_message(
|
||||
YaPlugView::GetSize{.owner_instance_id = owner_instance_id()});
|
||||
|
||||
*size = response.updated_size;
|
||||
*size = response.size;
|
||||
|
||||
return response.result;
|
||||
} else {
|
||||
|
||||
@@ -724,16 +724,16 @@ void Vst3Bridge::run() {
|
||||
[&](YaPlugView::GetSize& request) -> YaPlugView::GetSize::Response {
|
||||
// Melda plugins will refuse to open dialogs of this function is
|
||||
// not run from the GUI thread
|
||||
Steinberg::ViewRect size{};
|
||||
const tresult result =
|
||||
do_mutual_recursion_or_handle_in_main_context<tresult>(
|
||||
[&]() {
|
||||
return object_instances[request.owner_instance_id]
|
||||
.plug_view_instance->plug_view->getSize(
|
||||
&request.size);
|
||||
.plug_view_instance->plug_view->getSize(&size);
|
||||
});
|
||||
|
||||
return YaPlugView::GetSizeResponse{
|
||||
.result = result, .updated_size = std::move(request.size)};
|
||||
return YaPlugView::GetSizeResponse{.result = result,
|
||||
.size = std::move(size)};
|
||||
},
|
||||
[&](YaPlugView::OnSize& request) -> YaPlugView::OnSize::Response {
|
||||
// HACK: This function has to be run from the UI thread since
|
||||
|
||||
Reference in New Issue
Block a user