Rémi Bernon (@rbernon) commented about server/queue.c:
release_object( foreground ); }
- if ((device = current->process->rawinput_kbd) && (device->flags & RIDEV_NOLEGACY))
I wouldn't bother with this NOLEGACY thing, but if you really want to fix it I think it should probably be done in `queue_hardware_message`: as far as I can tell, ll-hooks should still called in all cases.
And in that queue_hardware_message function you have a call to `find_hardware_target_window` which does what you're doing here and returns the actual thread which should normally receive the message. You get its process there and check for that flag there.