Remove editor_double_embed

It's no longer needed after the `fix_local_coordinates()` change from a
fa12c64866a8b79e862bc5db4c4b092a4b762689.
This commit is contained in:
Robbert van der Helm
2021-08-16 21:10:16 +02:00
parent 9ac597a6fd
commit cc9226a3fc
7 changed files with 23 additions and 77 deletions
-6
View File
@@ -101,12 +101,6 @@ Configuration::Configuration(const fs::path& config_path,
} else {
invalid_options.push_back(key);
}
} else if (key == "editor_double_embed") {
if (const auto parsed_value = value.as_boolean()) {
editor_double_embed = parsed_value->get();
} else {
invalid_options.push_back(key);
}
} else if (key == "editor_force_dnd") {
if (const auto parsed_value = value.as_boolean()) {
editor_force_dnd = parsed_value->get();
-15
View File
@@ -94,20 +94,6 @@ class Configuration {
*/
std::optional<boost::filesystem::path> disable_pipes;
/**
* If this is set to `true`, then the plugin editor should be embedded in
* yet another window. This would result in an embedding sequence of
* `<window_provided_by_host> <-> <wine_parent_window> <->
* <wine_child_window> <-> <window_created_by_plugin>`, where
* `<wine_child_window>` is the new addition. The only plugin I've
* encountered where this was necessary was PSPaudioware E27 (and it likely
* also applies to other PSPaudioware plugins with expandable GUIs). I also
* haven't noticed any issues caused from having this enabled, but having it
* behind a flag reduces the amount of moving parts so that's probably a
* better idea.
*/
bool editor_double_embed = false;
/**
* If set to `true`, we'll remove the `XdndAware` property all ancestor
* windows in `editor.cpp`. This is needed for REAPER as REAPER implements
@@ -202,7 +188,6 @@ class Configuration {
s.ext(disable_pipes, bitsery::ext::InPlaceOptional(),
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
s.value1b(editor_double_embed);
s.value1b(editor_force_dnd);
s.value1b(editor_xembed);
s.ext(frame_rate, bitsery::ext::InPlaceOptional(),
-3
View File
@@ -255,9 +255,6 @@ class PluginBridge {
"hack: pipes disabled, plugin output will go to \"" +
config.disable_pipes->string() + "\"");
}
if (config.editor_double_embed) {
other_options.push_back("editor: double embed");
}
if (config.editor_force_dnd) {
other_options.push_back("editor: force drag-and-drop");
}
+2 -27
View File
@@ -299,10 +299,6 @@ Editor::Editor(MainContext& main_context,
nullptr,
GetModuleHandle(nullptr),
this)),
// If `config.editor_double_embed` is set, then we'll also create a child
// window in `win32_child_window`. If we do this before calling
// `ShowWindow()` on `win32_window` we'll run into X11 errors.
win32_child_window(std::nullopt),
idle_timer(
Win32Timer(win32_window.handle,
idle_timer_id,
@@ -427,23 +423,7 @@ Editor::Editor(MainContext& main_context,
// described in `Editor`'s docstring'.
do_reparent(wine_window, wrapper_window.window);
// If we're using the double embedding option, then the child window
// should only be created after the parent window is visible
ShowWindow(win32_window.handle, SW_SHOWNORMAL);
if (config.editor_double_embed) {
// As explained above, we can't do this directly in the initializer
// list
win32_child_window.emplace(
main_context, x11_connection,
CreateWindowEx(WS_EX_TOOLWINDOW,
reinterpret_cast<LPCSTR>(get_window_class()),
"yabridge plugin child", WS_CHILD, 0, 0,
client_area.width, client_area.height,
win32_window.handle, nullptr,
GetModuleHandle(nullptr), this));
ShowWindow(win32_child_window->handle, SW_SHOWNORMAL);
}
}
}
@@ -727,12 +707,7 @@ void Editor::handle_x11_events() noexcept {
}
HWND Editor::get_win32_handle() const noexcept {
// FIXME: The double embed and XEmbed options don't work together right now
if (win32_child_window && !use_xembed) {
return win32_child_window->handle;
} else {
return win32_window.handle;
}
return win32_window.handle;
}
void Editor::fix_local_coordinates() const {
@@ -937,7 +912,7 @@ std::optional<POINT> Editor::get_current_pointer_position() const noexcept {
// expose a function that just lets us translate X11 coordinates into
// Windows coordinates.
RECT win32_pos{};
if (!GetWindowRect(get_win32_handle(), &win32_pos)) {
if (!GetWindowRect(win32_window.handle, &win32_pos)) {
return std::nullopt;
}
+1 -12
View File
@@ -213,8 +213,7 @@ class Editor {
/**
* Get the Win32 window handle so it can be passed to an `effEditOpen()`
* call. This will return the child window's handle if double editor
* embedding is enabled.
* call.
*/
HWND get_win32_handle() const noexcept;
@@ -365,16 +364,6 @@ class Editor {
*/
DeferredWin32Window win32_window;
/**
* A child window embedded inside of `win32_window`. This is only used if
* the `editor_double_embed` option is enabled. It can be used as a
* workaround for plugins that rely on their parent window's screen
* coordinates instead of their own (see the 'Editor hosting modes' section
* of the readme for more details). The plugin should then embed itself
* within this child window.
*/
std::optional<DeferredWin32Window> win32_child_window;
/**
* A timer we'll use to periodically run the X11 event loop plus
* `idle_timer_proc`, if that is set. We handle X11 events from within the