Hi, Sergey. Though I don't know much, there's no reply, so I dare one...
It may be related to replay-keyboard & replay-pointer. For example, if "focus-click-through" is t, and focus mode is "click", then the click focuses the window, and the same click is handed off to the underlying window, too. It's coded in wm/focus.jl. Hope this helps, Teika (Teika kazura)
