mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Also listen for ConfigureNotify on the wrapper
This is needed for Tracktion Waveform because they shift our wrapper window a bit downwards. Otherwise opening the window while your mouse cursor is already inside of it would trip up Wine's coordinates.
This commit is contained in:
@@ -65,6 +65,17 @@ constexpr uint32_t parent_event_mask =
|
|||||||
host_event_mask | XCB_EVENT_MASK_FOCUS_CHANGE |
|
host_event_mask | XCB_EVENT_MASK_FOCUS_CHANGE |
|
||||||
XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW;
|
XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The X11 event mask for our wrapper window.
|
||||||
|
*
|
||||||
|
* NOTE: The only reason we need this structure notify mask is because Tracktion
|
||||||
|
* Waveform offsets our window a bit vertically, so we need to catch that
|
||||||
|
* `ConfigureNotify` event or else the mouse clicks would be offset
|
||||||
|
* slightly when the mouse is already inside of the editor window when
|
||||||
|
* opening it.
|
||||||
|
*/
|
||||||
|
constexpr uint32_t wrapper_event_mask = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the X11 property on the root window used to denote the active
|
* The name of the X11 property on the root window used to denote the active
|
||||||
* window in EWMH compliant window managers.
|
* window in EWMH compliant window managers.
|
||||||
@@ -381,6 +392,8 @@ Editor::Editor(MainContext& main_context,
|
|||||||
XCB_CW_EVENT_MASK, &host_event_mask);
|
XCB_CW_EVENT_MASK, &host_event_mask);
|
||||||
xcb_change_window_attributes(x11_connection.get(), parent_window,
|
xcb_change_window_attributes(x11_connection.get(), parent_window,
|
||||||
XCB_CW_EVENT_MASK, &parent_event_mask);
|
XCB_CW_EVENT_MASK, &parent_event_mask);
|
||||||
|
xcb_change_window_attributes(x11_connection.get(), wrapper_window.window,
|
||||||
|
XCB_CW_EVENT_MASK, &wrapper_event_mask);
|
||||||
xcb_flush(x11_connection.get());
|
xcb_flush(x11_connection.get());
|
||||||
|
|
||||||
// First reparent our dumb wrapper window to the host's window, and then
|
// First reparent our dumb wrapper window to the host's window, and then
|
||||||
@@ -491,7 +504,8 @@ void Editor::handle_x11_events() noexcept {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (event->window == host_window ||
|
if (event->window == host_window ||
|
||||||
event->window == parent_window) {
|
event->window == parent_window ||
|
||||||
|
event->window == wrapper_window.window) {
|
||||||
if (!use_xembed) {
|
if (!use_xembed) {
|
||||||
fix_local_coordinates();
|
fix_local_coordinates();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user