On Mon Sep 30 17:14:00 2024 +0000, Rémi Bernon wrote:
Do you have any application that uses WinTab? I thought it was some old and unused part of the code, but I've seen people asking for it for the wayland driver too, and I'm wondering if we could implement it in a generic way on top of the early pointer / HID device support we now have.
Hmm. I think most applications that support WinTab32 now also support using the newer pointer events API directly, e.g. Clip Studio, Painttool SAI 2, etc. I think we definitely want to keep WinTab32 support overall: - Older software will still use WinTab32 only (e.g. Painttool SAI 1, which people still use) - Even newer software may still need WinTab32 for certain things. (As an example, SAI 2 supports using SAI 1's brush engine, but then you're stuck with WinTab32. Some artists rely on this feature.) - Some features of the WinTab32 API (e.g. absolute input mode) can't be implemented, as far as I know, directly with the pointer API. (I'm not sure if anyone actually cares about this feature anymore, though.) - The Pointer API is limited to 1024 pressure levels. On Wayland we're only limited to 65536 pressure levels. (In practice I think this is not a huge concern, but it is worth calling out.)
Even with that said, it would be immensely cleaner, so I would love to implement WinTab32 in terms of the pointer API instead if we could, but I have struggled over the years to make patches to implement the Windows pointer events API in the first place. It's hard to test it since we can't really implement the synthetic pointer API, there's no way to e.g. inject events at the display server level with XI2. That said, I did a lot of ground work trying to [figure out how the pointer API works](https://github.com/jchv/WmPointerDemo/) (completely clean-room of course.) I'm not sure how much we should try to mirror what Windows does. I'm guessing first-party software will use the undocumented per-window setting for mouse-in-pointer, for example.
I think I posted to the mailing list about this a while ago but didn't manage to catch any attention so I assumed there wasn't much interest. I'm happy to work on this if there is interest.