In the XInput 2 event dispatching code, we propagate focus out events starting from the child's parent up to (but excluding) the ancestor window (see DeviceFocusOutEvents). However, NotifyPointer focus out events should also be sent to the window containing the pointer (the child itself), as performed by the core input event system. This surfaced as a bug in Firefox/GTK3 that caused focus handing to fail due to a missing FocusOut (detail=NotifyPointer) event when focus was moved from PointerRoot to another toplevel after a window's destruction. As a GTK window's focus is changed when a NotifyPointer event occurs on a window, this was causing the window to permanently retain focus (according to GTK, at least). This does not occur on the core/non-xi2 backend, which does send NotifyPointer focus out events to the pointer window. The events that should occur when moving from PointerRoot to another window are detailed quite well here; https://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html
Patch at https://lists.x.org/archives/xorg-devel/2015-December/048389.html
commit 2fbf5c2f91d33efbda573c4be036248b1d8ed7f1 Author: Andrew Comminos <andrew@comminos.com> Date: Tue Dec 29 23:41:27 2015 -0800 Input: Send XI2 FocusOut NotifyPointer events to the pointer window.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.