mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 13:40:05 +02:00
Remove editor_double_embed
It's no longer needed after the `fix_local_coordinates()` change from a fa12c64866a8b79e862bc5db4c4b092a4b762689.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user