Then, assuming input is dispatched correctly, and assuming wineserver is informed of focus loss so that the old window doesn't receive the repeated input, you could simply keep the repeating active until another window gains focus and can tell wineserver of the updated key state, clearing repeat timer or starting repeat again if any keys are still pressed.
Alright, let me experiment a bit with these ideas. A couple of early thoughts:
1. Concerning giving up focus on the keyboard leave event, I remember that we don't do it because of unfortunate side-effects, but I will need to revisit to remember the details and see if/how we can make some progress here.
2. Wouldn't keeping the repeat active in wineserver cause unnecessary cpu usage? Should we effectively pause the repeat until we have a new focused window?