On 2020-06-24 13:23, Rémi Bernon wrote:
This delivers the rawinput messages to the correct process, regardless of where the input was received.
As for now RIDEV_INPUTSINK is still not implemented, this only fixes the case where input is injected in a background process and where it should not receive rawinput -as in the test- or when cursor moves over a background window and the foreground process should have received rawinput messages.
And now that I'm not head down into trying to tweak the patches anymore, and that I start looking around, I realize it's probably still quite suspicious... sorry about the noise.
+/* get the foreground thread for a desktop and a window receiving input */ +static struct thread *get_foreground_thread( struct desktop *desktop, user_handle_t window ) +{
- /* if desktop has no foreground process, assume the receiving window is */
- if (desktop->foreground_input) return get_window_thread( desktop->foreground_input->active );
- if (window) return get_window_thread( get_user_full_handle( window ) );
- return NULL;
+}
This should for instance be ->focus and not ->active.
I also now see that the target window dispatch is already pretty much in queue_hardware_message and find_hardware_message_window. So queue_rawinput_message could be simplified again.
I don't see anywhere a cross-desktop check like the one that seems to be required for rawinput (where if the target window is on another desktop, messages should not be sent unless the process has input focus).