diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index 85af6ad2..a218a8b8 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -524,10 +524,6 @@ void Editor::handle_x11_events() noexcept { // dialog, since that often won't trigger an `EnterNotify'. case XCB_ENTER_NOTIFY: case XCB_FOCUS_IN: { - if (!use_xembed) { - fix_local_coordinates(); - } - const xcb_window_t window = event_type == XCB_ENTER_NOTIFY ? reinterpret_cast( @@ -549,6 +545,10 @@ void Editor::handle_x11_events() noexcept { }); } + if (window == parent_window && !use_xembed) { + fix_local_coordinates(); + } + // In case the WM somehow does not support // `_NET_ACTIVE_WINDOW`, a more naive focus grabbing method // implemented in the `WM_PARENTNOTIFY` handler will be