XI2 DirectInput/RawInput/WH_*_LL hooks

Paul TBBle Hampson Paul.Hampson at Pobox.com
Sun Jun 21 23:00:39 CDT 2009


I've been thinking about the XI2 a fair bit since the last
time we discussed it on the mailing list, and a few things
have come to mind, which I think need sanity checking before
I explore any harder.

I'm assuming we want one X11 connection turning XI2 events into WH_*_LL
events, RawInput events, and DirectInput events, simply because WH_*_LL
events are actually sent out by wineserver to all processes, so we only
want one of those per XI2 event.

This leads me to retaining the current WH_*_LL-based implementation of
DI, but with cursor management and control (ie all the stuff Exclusive
mode brings to the table) handling via a graphics driver hook or
similar.

However, the mechanism for feeding the XI2 events to the wineserver as
WH_*_LL events is a little tricky.

XI2 events need their own thread and hence X connection, as we cannot
rely on a WinMain loop hitting X11DRV_MsgWaitForMultipleObjectsEx in a
timely manner, or in fact all.

The three possibilities I see are:

*) Most recent foreground application catches XI2 events in its own
spawned thread. Need to elect a replacement on process exit. Easiest to
co-ordinate with non-XI2 hook-feeding code.

*) Wineserver gains an X11 connection, for XI2 use only. This is
generally bad, only here for completeness.

*) A new process (ala services.exe) which grabs XI2 events from X11 via
its own connection and feeds them to the wineserver.

I'm inclined to think the latter one is the best option of the three,
and it requires simply that the winex11.drv detect XI2 presence and if
found, it disable its own WH_*_LL feeding code and spawn the XI2 process
if it is not already running.

It avoids the complicated coordination dance you would need for the
first option to avoid losing messages.

Mind you, I've been thinking this away from the codebase, so it's
mostly mindwork right now. But unless I get any better suggestions or
criticism, I'll prolly knock up a sample implementation of the third
option next time I play with this, and see if I can get the DI keyboard
interface implemented.

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, B.Sc, LPI, MCSE
Very-later-year Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.com

Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
 -- Marcus Brigstocke
http://www.marcusbrigstocke.com/pacman.asp

License: http://creativecommons.org/licenses/by/2.5/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090622/3b9bf5db/attachment-0001.pgp>


More information about the wine-devel mailing list