Previously we would try to guess what the main tablet device is, but this is error prone. Now we keep a list of X11 devices and try to match events to them. On the Blender side there are still some limitations in regards to using multiple devices at the same time, but this should improve things already. Fixes T59645.