Stylus Mapping bug with multi-monitor & multi-DPI setups
This issue was previously discussed on the issue tracker of Xournal++.
Steps to reproduce
- Have more than one monitor active, with at least one (and not all) monitor on a high-DPI setting (Windows settings -> System -> Display -> Scaling percentage for the monitor > 100%) and the others at 100% DPI. The exact combinations that make this fail are not exactly known, but I have tried multiple, including having the stylus drawing monitor scaled and unscaled, as well as scaling other monitors.
- Use any application that provides instant visual feedback for stylus input. I tested both Xournal++ and Inkscape.
- Observe the stylus location as observed by the program versus the operating system (mouse pointer and touch animations).
Current behavior
The stylus press is mapped to an offset wrong location; judging by how the offset changes over the drawing surface, it seems like GTK assumes the stylus screen space to be larger or smaller than it actually is. The exact offsets and behaviors vary with monitor scaling, order, and resolution. The only possible workaround was found by @allenzhao on the Xournal++ issue tracker (see above) and simply involves setting all screens to 100% DPI (unscaled).
Expected outcome
The stylus press should map to the position that the operating system detects it at, i.e. at the physical location of the stylus where the mouse pointer is drawn.
Version information
- GTK 3.24.23 for Xournal++ 1.0.19, Inkscape 1.0.1 (unknown GTK version)
- OS: Windows 10 version 1909 (it is not known whether this issue occurs on other OSes but it seems likely)
Additional information
The exact monitors in my setup is one 768x1024 on 100% DPI, one 3840x2160 (4K) on 150% DPI, and the tablet screen 1920x1080 (HD) on 100% DPI. I use an XP-Pen Artist 12 drawing tablet that cooperates nicely with all non-GTK applications.
This issue also happened with Blackmagic Design's DaVinci Resolve 16 and 17 beta, which I don't think use GTK (only QT 5, couldn't find any DLLs that are named GTK).
I had several instances for Xournal++ where the bug suddenly went away with active scaling differences, then reappeared on changing scaling once again, or logging out and back in again, or restarting.