Initially I almost got tricked/confused by this too, but it's actually not a bug :)
Here are comments for the first round of code review. The patch looks acceptable quite soon.
Is this on the same machine?
Could you try if using factory settings helps?
@Blendify I'm sorry, but I'm afraid tablet input is really beyond the scope of this patch (and my abilities; I'm not very familiar with the Blender source).
Two-finger scroll gets picked up as a pan event
strange! this works ok with me, when:
I think if you could work this patch so that it will pick up input from tablets will be much more helpful to users since the majority of people most likely have a desktop system
Other than the inline comment it looks ok to me.
Please upload your file, so that others can check and fix the error.