diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index bbe51fe4..bc353f55 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -48,18 +48,6 @@ HWND Editor::open(AEffect* effect) { return win32_handle->get(); } -bool Editor::resize(const VstRect& new_size) { - if (!win32_handle.has_value()) { - return false; - } - - SetWindowPos(win32_handle->get(), HWND_TOP, new_size.left, new_size.top, - new_size.right - new_size.left, new_size.bottom - new_size.top, - 0); - - return true; -} - void Editor::close() { // RAII will destroy the window and tiemrs for us win32_handle = std::nullopt; @@ -128,6 +116,7 @@ void Editor::handle_events() { // Handle X11 events // TODO: Check if we should forward other events mostly to prevent // unnecessary GUI processing in the background + // TODO: Check whether drag and drop works out of the box xcb_generic_event_t* generic_event; while ((generic_event = xcb_poll_for_event(x11_connection.get())) != nullptr) { @@ -140,6 +129,11 @@ void Editor::handle_events() { break; } + // The client area of the Win32 window doesn't expand + // automatically + SetWindowPos(win32_handle->get(), HWND_TOP, 0, 0, + event.width, event.height, 0); + // We're purposely not using XEmbed. This has the // consequence that wine still thinks that any X and Y // coordinates are relative to the x11 window root instead diff --git a/src/wine-host/editor.h b/src/wine-host/editor.h index 896293c5..14651cae 100644 --- a/src/wine-host/editor.h +++ b/src/wine-host/editor.h @@ -57,16 +57,6 @@ class Editor { void close(); - /** - * Resize the window to match the given size, if open. - * - * @param new_size The rectangle with the plugin's current position. - * - * @return Whether the resizing was succesful. Will return false if the - * editor isn't open. - */ - bool resize(const VstRect& new_size); - /** * Embed the (open) window into a parent window. * diff --git a/src/wine-host/plugin-bridge.cpp b/src/wine-host/plugin-bridge.cpp index f34e6a2d..ea0c8716 100644 --- a/src/wine-host/plugin-bridge.cpp +++ b/src/wine-host/plugin-bridge.cpp @@ -298,17 +298,6 @@ class HostCallbackDataConverter : DefaultDataConverter { case audioMasterGetTime: return WantsVstTimeInfo{}; break; - case audioMasterSizeWindow: - // Plugins use this opcode to indicate that their editor should - // be resized, so we'll have to update the Wine window - // accordingly - // TODO: Can we just do this when handling XCB_CONFIGURE_NOTIFY - // instead? - editor.resize(VstRect{0, 0, static_cast(value), - static_cast(index)}); - - return DefaultDataConverter::read(opcode, index, value, data); - break; case audioMasterIOChanged: // This is a helpful event that indicates that the VST plugin's // `AEffect` struct has changed. Writing these results back is