From: Piotr Caban Subject: Re: [PATCH] server: Don't wait for low level hook result when queueing hardware message. Message-Id: <90684755-ad7b-aea8-c650-418ff130c82e@gmail.com> Date: Tue, 14 Sep 2021 21:03:46 +0200 In-Reply-To: <1aab92cb-ef40-cbe8-e3c5-59594708fc5f@codeweavers.com> References: <2c64833d-b189-cb6b-7274-f5a0b7c71ac2@codeweavers.com> <267cdbe1-c8f2-9630-c4de-e6fb725334de@gmail.com> <1aab92cb-ef40-cbe8-e3c5-59594708fc5f@codeweavers.com> On 9/14/21 7:57 PM, Rémi Bernon wrote: > On 9/14/21 7:37 PM, Piotr Caban wrote: >> On 9/14/21 7:03 PM, Rémi Bernon wrote: >>> With an HID test signed driver, like I'm currently adding for dinput >>> testing, we could test mouse and keyboard input without going through >>> SendInput / kbd_event / mouse_event. >> The problem is that I need the event to originate from graphics driver >> to show the bug. It's currently the only path that calls ll hooks. >> >> Thanks, >> Piotr > > Yes, of course. > > Then I think the issue may be more about the graphics driver > architecture, where we poll and process X11 events in > MsgWaitForMultipleObjects. > > I remember quite some time ago that for some reason I removed the wait > for ll-hooks and julliard told me that it was needed for proper ll-hook > processing. > > I'm still not much more knowledgeable about how ll-hooks work right now, > but it may still be required, and the correct fix would be to have mouse > and keyboard input coming from a separate source, as we do for other > devices. > > It's a pretty big change and has a lot of implications though. I fail to see how it breaks ll-hooks processing. I've also done quite a lot of testing and it seems to be working good. Yes, having __wine_send_input in separate thread/process will also fix the issue. If it's preferred to add something like wine keyboard driver that accepts key events from graphic drivers I can try to investigate it. I think that pumping X11 events in MsgWaitForMultipleObjects is a separate issue. No matter where we do the pumping we don't want it to hung on ll hook.