Sorry, for some reason I have been thinking that you had a problem with too many events sent to the main window.
Anyway, your problem is purely down the event handler (or something else on the main thread) taking up too much time. It is blocking the main thread from handling events quickly, and that is why a key press on mainwindow is getting delayed and sent to another window.
Move heavy work out of the gui thread - it should not be there anyway.
Bookmarks