mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Replace Xlib with xcb
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
ATOM register_window_class(std::string window_class_name);
|
||||
|
||||
Win32Editor::Win32Editor(std::string window_class_name)
|
||||
: window_class(register_window_class(window_class_name)) {}
|
||||
: window_class(register_window_class(window_class_name)),
|
||||
x11_connection(xcb_connect(nullptr, nullptr), &xcb_disconnect) {}
|
||||
|
||||
HWND Win32Editor::open() {
|
||||
window_handle =
|
||||
@@ -20,14 +21,17 @@ HWND Win32Editor::open() {
|
||||
void Win32Editor::close() {
|
||||
// RAII does the rest for us
|
||||
window_handle = std::nullopt;
|
||||
|
||||
// TODO: Do we need to do something on the X11 side or does the host do
|
||||
// everything for us?
|
||||
}
|
||||
|
||||
std::optional<intptr_t> Win32Editor::get_x11_handle() {
|
||||
std::optional<xcb_window_t> Win32Editor::get_x11_handle() {
|
||||
if (!window_handle.has_value()) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return reinterpret_cast<intptr_t>(
|
||||
return reinterpret_cast<size_t>(
|
||||
GetProp(window_handle.value().get(), "__wine_x11_whole_window"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user