Comment 30 for bug 151448

Revision history for this message
In , Xixsimplicityxix (xixsimplicityxix) wrote :

Thanks for the encouragement =) I don't know about the comment editing.

Well where I'm at now. SAI doesn't seem to have true parent x11 window. Right now in mainline wine we pass the hwnd of the tablet context to AttachEventQueueToTablet => x11drv_get_whole_window. This is not right as the hwnd of the context could be a child window and those don't have valid x11 windows associated with them so x11drv_get_whole_window will return 0 which prevents us from getting xInputEvents. I'm pretty sure that we should actually do something like this: AttachEventQueueToTablet( GetAncestor(hWnd, GA_ROOT) ) which would return a parent window for sure giving us an x11 window and then giving us those events.

Ofc this doesn't work or I'd just have posted a patch and not all this blather tonight. It seems that there is no valid parent window for the hwnd sai creates for the tablet context. So I'm not sure what that means....

My guess is that it just creates a child window to the root window. If that is the case then our code needs to be something like this:

if (!AttachEventQueueToTablet( GetAncestor(hWnd, GA_ROOT) )) AttachEventQueueToTablet( GetDesktopWindow() );

Which I've tried and that does get xinput events flowing (yay!) BUT pressure still doesn't work in sai. I'm not sure at this point if there is some problem elsewhere or if the problem is because the above isnt the right fix. Dunno when I'll check this out next going to be busy next week and me soo tired right now =P