Check the window in focus/enter events

This commit is contained in:
Robbert van der Helm
2021-07-21 22:29:16 +02:00
parent cb1c1858e0
commit 68c47064a0
+4 -4
View File
@@ -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<xcb_enter_notify_event_t*>(
@@ -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