Translate mouse coordinates from Wine window

Instead of the parent Window. Tracktion Waveform does some weird things
with its VST2 editor embedding, so with the old approach this would
cause mouse clicks to be offset 27 pixels vertically and one pixel
horizontally.
This commit is contained in:
Robbert van der Helm
2021-06-05 11:32:24 +02:00
parent 9254d73c9d
commit 974951e966
2 changed files with 14 additions and 1 deletions
+7
View File
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed mouse clicks in VST2 editors in **Tracktion Waveform** being offset
vertically because of the way Waveform embeds VST2 editors.
## [3.3.0] - 2020-06-03
### Added
+7 -1
View File
@@ -480,9 +480,15 @@ void Editor::fix_local_coordinates() const {
// We can't directly use the `event.x` and `event.y` coordinates because the
// parent window may also be embedded inside another window.
// HACK: Tracktion Waveform uses client side decorations, and for VST2
// plugins they forgot to add a separate parent window that's already
// offset correctly. Instead, they'll have the plugin embed itself
// inside directly inside of the dialog, and Waveform then moves the
// window 27 pixels down. That's why we cannot use `parent_window`
// here.
xcb_generic_error_t* error;
const xcb_translate_coordinates_cookie_t translate_cookie =
xcb_translate_coordinates(x11_connection.get(), parent_window, root, 0,
xcb_translate_coordinates(x11_connection.get(), wine_window, root, 0,
0);
xcb_translate_coordinates_reply_t* translated_coordinates =
xcb_translate_coordinates_reply(x11_connection.get(), translate_cookie,