mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
VST3: Create the window with the plugin-returned initial size
Instead of creating the window as 128x128 and then resizing, create it with the size requested by the plugin. Fixes Korg VST3 plugins.
This commit is contained in:
committed by
Robbert van der Helm
parent
b2db9cc0a6
commit
6f65613292
@@ -799,9 +799,16 @@ void Vst3Bridge::run() {
|
|||||||
// be done in the main UI thread
|
// be done in the main UI thread
|
||||||
return main_context_
|
return main_context_
|
||||||
.run_in_context([&, &instance = instance]() -> tresult {
|
.run_in_context([&, &instance = instance]() -> tresult {
|
||||||
|
Steinberg::ViewRect size;
|
||||||
|
std::optional<Size> initial_size;
|
||||||
|
if (instance.plug_view_instance->plug_view->getSize(
|
||||||
|
&size) == Steinberg::kResultOk) {
|
||||||
|
initial_size.emplace(size.getWidth(),
|
||||||
|
size.getHeight());
|
||||||
|
}
|
||||||
Editor& editor_instance = instance.editor.emplace(
|
Editor& editor_instance = instance.editor.emplace(
|
||||||
main_context_, config_, generic_logger_,
|
main_context_, config_, generic_logger_, x11_handle,
|
||||||
x11_handle);
|
std::nullopt, initial_size);
|
||||||
const tresult result =
|
const tresult result =
|
||||||
instance.plug_view_instance->plug_view->attached(
|
instance.plug_view_instance->plug_view->attached(
|
||||||
editor_instance.win32_handle(), type.c_str());
|
editor_instance.win32_handle(), type.c_str());
|
||||||
|
|||||||
@@ -256,12 +256,13 @@ Editor::Editor(MainContext& main_context,
|
|||||||
const Configuration& config,
|
const Configuration& config,
|
||||||
Logger& logger,
|
Logger& logger,
|
||||||
const size_t parent_window_handle,
|
const size_t parent_window_handle,
|
||||||
std::optional<fu2::unique_function<void()>> timer_proc)
|
std::optional<fu2::unique_function<void()>> timer_proc,
|
||||||
|
std::optional<Size> initial_size)
|
||||||
: use_force_dnd_(config.editor_force_dnd),
|
: use_force_dnd_(config.editor_force_dnd),
|
||||||
logger_(logger),
|
logger_(logger),
|
||||||
x11_connection_(xcb_connect(nullptr, nullptr), xcb_disconnect),
|
x11_connection_(xcb_connect(nullptr, nullptr), xcb_disconnect),
|
||||||
dnd_proxy_handle_(WineXdndProxy::get_handle()),
|
dnd_proxy_handle_(WineXdndProxy::get_handle()),
|
||||||
wrapper_window_size_({128, 128}),
|
wrapper_window_size_(initial_size.value_or(Size(128, 128))),
|
||||||
host_window_config_({}),
|
host_window_config_({}),
|
||||||
parent_window_config_({}),
|
parent_window_config_({}),
|
||||||
// Create a window without any decoratiosn for easy embedding. The
|
// Create a window without any decoratiosn for easy embedding. The
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ class Editor {
|
|||||||
const Configuration& config,
|
const Configuration& config,
|
||||||
Logger& logger,
|
Logger& logger,
|
||||||
const size_t parent_window_handle,
|
const size_t parent_window_handle,
|
||||||
std::optional<fu2::unique_function<void()>> timer_proc = std::nullopt);
|
std::optional<fu2::unique_function<void()>> timer_proc = std::nullopt,
|
||||||
|
std::optional<Size> initial_size = std::nullopt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize the `wrapper_window_` to this new size. We need to manually call
|
* Resize the `wrapper_window_` to this new size. We need to manually call
|
||||||
|
|||||||
Reference in New Issue
Block a user