Do you think the issue is as simple as debugging the code that detect when pen is about to be used and store the object properties and then when pen stops being used making sure all object properties are restored back to the previous properties before pen was used?
Object… properties? It’s going to be some time until I focus my attention towards MyPaint’s HID code specifically, but it’s most likely a problem with GTK rather than with MyPaint.
Not sure if this would be any use, but I am on the same platform with a different tablet, so I tried reproducing this problem with the same sequence of steps and I couldn’t reproduce it.
Windows 11 64 bit, with MyPaint 2.0.1+git.478280f2, Huion HS64 tablet.
I am using the standalone 7z archive version of the package from the official website instead of an installed version from the provided installer.
With Windows 11, GTK input handling + Wacom gets odd after alt+tab. GTK may become stuck using the pen as the primary pointer and fail to re-register mouse events if it is the final active device. MyPaint isn’t shifting device state itself, it’s just not accepting mouse input anymore.
the “restore object properties” approach doesn’t really apply here - this lives at the GTK / GdkSeat level. you’ll notice similar behavior in other GTK apps on Windows when blending pen + mouse + focus changes.
if the mouse dies in another GTK app with the same Wacom driver after alt+tab, that confirms it’s upstream, not MyPaint.