mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Fix reopening closed editor windows
This commit is contained in:
@@ -7,8 +7,7 @@ Yet Another way to use Windows VST2 plugins in Linux VST hosts.
|
|||||||
There are a few things that should be done before releasing this, including:
|
There are a few things that should be done before releasing this, including:
|
||||||
|
|
||||||
- Fix implementation bugs:
|
- Fix implementation bugs:
|
||||||
- Fix hiding and showing of editor windows, closing a window with alt+f4
|
- Closing editor windows is slow, this can be improved,
|
||||||
freezes the editor,
|
|
||||||
- Polish GUIs even further. There are some todos left in
|
- Polish GUIs even further. There are some todos left in
|
||||||
`src/wine-host/editor.{h,cpp}`.
|
`src/wine-host/editor.{h,cpp}`.
|
||||||
- There are likely some minor issues left.
|
- There are likely some minor issues left.
|
||||||
|
|||||||
@@ -30,18 +30,25 @@ xcb_window_t get_x11_handle(HWND win32_handle);
|
|||||||
|
|
||||||
ATOM register_window_class(std::string window_class_name);
|
ATOM register_window_class(std::string window_class_name);
|
||||||
|
|
||||||
|
WindowClass::WindowClass(std::string name)
|
||||||
|
: atom(register_window_class(name)) {}
|
||||||
|
|
||||||
|
WindowClass::~WindowClass() {
|
||||||
|
UnregisterClass(reinterpret_cast<LPCSTR>(atom), GetModuleHandle(nullptr));
|
||||||
|
}
|
||||||
|
|
||||||
Editor::Editor(const std::string& window_class_name,
|
Editor::Editor(const std::string& window_class_name,
|
||||||
AEffect* effect,
|
AEffect* effect,
|
||||||
std::mutex& effect_mutex,
|
std::mutex& effect_mutex,
|
||||||
const size_t parent_window_handle)
|
const size_t parent_window_handle)
|
||||||
: window_class(register_window_class(window_class_name)),
|
: window_class(window_class_name),
|
||||||
// Create a window without any decoratiosn for easy embedding. The
|
// Create a window without any decoratiosn for easy embedding. The
|
||||||
// combination of `WS_EX_TOOLWINDOW` and `WS_POPUP` causes the window to
|
// combination of `WS_EX_TOOLWINDOW` and `WS_POPUP` causes the window to
|
||||||
// be drawn without any decorations (making resizes behave as you'd
|
// be drawn without any decorations (making resizes behave as you'd
|
||||||
// expect) and also causes mouse coordinates to be relative to the window
|
// expect) and also causes mouse coordinates to be relative to the window
|
||||||
// itself.
|
// itself.
|
||||||
win32_handle(CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_ACCEPTFILES,
|
win32_handle(CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_ACCEPTFILES,
|
||||||
reinterpret_cast<LPCSTR>(window_class),
|
reinterpret_cast<LPCSTR>(window_class.atom),
|
||||||
"yabridge plugin",
|
"yabridge plugin",
|
||||||
WS_POPUP,
|
WS_POPUP,
|
||||||
CW_USEDEFAULT,
|
CW_USEDEFAULT,
|
||||||
|
|||||||
+16
-1
@@ -17,6 +17,21 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A basic RAII wrapper around the Win32 window class system, for use in the
|
||||||
|
* Editor class below.
|
||||||
|
*/
|
||||||
|
class WindowClass {
|
||||||
|
public:
|
||||||
|
WindowClass(std::string name);
|
||||||
|
~WindowClass();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Win32 window class registered for the windows window.
|
||||||
|
*/
|
||||||
|
const ATOM atom;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper around the win32 windowing API to create and destroy editor
|
* A wrapper around the win32 windowing API to create and destroy editor
|
||||||
* windows. We can embed this window into the window provided by the host, and a
|
* windows. We can embed this window into the window provided by the host, and a
|
||||||
@@ -74,7 +89,7 @@ class Editor {
|
|||||||
/**
|
/**
|
||||||
* The Win32 window class registered for the windows window.
|
* The Win32 window class registered for the windows window.
|
||||||
*/
|
*/
|
||||||
ATOM window_class;
|
WindowClass window_class;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user