Hi! After this commit I've noticed some strange behaviour in code and wanted to ask you if it is expected.
Now every key event (on Win at least) gets passed to EventProcessor::OnEventFromSource twice, the first time from DesktopWindowTreeHostWin::HandleKeyEvent and the second time from WindowTreeHost::DispatchKeyEventPostIME. It happens so that the call to WindowEventDispatcher::PreDispatchEvent actually sends event to ime and, if not handled there, again to OnEventFromSource resulting in recursive call.
To be honest I have not found a way it could cause bugs. But such behavior seems strange and unexpected. It also leads to execution of some code twice. Could you tell me if it is considered to be correct behaviour or be revised later? Thanks!
I responded over email, but I'm adding here for the record:
While weird, I believe this is expected in the case of no ime. The first pass ends up in WindowTreeHost::DispatchKeyEventPostIME() which sets WindowEventDispatcher::skip_ime so that second pass doesn't trigger going through IME and does the normal processing. The first pass ends earlier than the second pass because of DispatchKeyEventPostIME().
Comment 1 by sky@chromium.org
, May 8 2017