Win10-64 and 4K display: Location of display cursor and mark don't match
Using MyPaint 1.2.1 and 1.0 on a 4K display in Windows 10-64, the resulting mark is offset to the left of the display cursor. The offset amount decreases as cursor moves to the right side of the display, but never reaches zero. This issue does not occur in other painting apps.
MyPaint version: 1.2.1 stable and 1.0 Operating system: Windows 10-64 Desktop environment: ViewSonic 4K display, Wacom Intuos4 Large
Steps to reproduce
- Start MyPaint
- Draw. Mark occurs to the left of the display cursor.
Could you please download and install the latest alpha build from the link and see if the problem still persists?
https://ci.appveyor.com/project/achadwick/mypaint/build/1.3.0-alpha+master.89/job/sb8etvkxrubomqu8/artifacts
Can you reliably click on toolbar buttons?
With the alpha build, please try the included "GTK3 demo" and see if the problem is present in that. Sounds a lot more like a problem with the underlying GTK libraries than MyPaint, but it is possible we're mis-handling some scaling thing (but it'd get "closer" towards the top-left, not the top-right corner, so maybe not).
I downloaded the latest 1.3.0 alpha and ran it for over an hour in different scenarios.
The offset problem persists, but it turns out is only one problem state of two.
State (1) when writing with the pen, the mark is made to the left of the cursor. Offset is along the horizontal X axis only and is greater on the screen's left and decreases moving to the right, but is never zero. The offset persists when selecting from the toolbar or menu. No offset problem exists along the Y axis. State (2) the tablet is not recognized and is interpreted as a mouse device as determined by Help>Debug>Test Input Device.
Usually, MyPaint starts in state (2). I have not been able to reliably get it into state (1), but usually running another pen app, such as Sketchbook Pro or ArtRage and then returning to a running MyPaint or restarting MyPaint will get it into state (1). Once in state (1), stopping and restarting the Wacom Tablet Service usually returns it to state (2).
I wasn't able to find the GTK3 demo in either the installed files or MyPaint menu options. If you will direct me to it, I'll try running it.
I ran mostly 1.3.0 alpha, but the described behavior was also exhibited in MyPaint 1.0.0.
I don't think we bundled it in our alpha builds yet. For now you can grab the GTK Demo example from the tool we use to bundle MyPaint for Windows: https://ci.appveyor.com/project/achadwick/styrene/build/0.3.0-alpha+master.16/job/p3hnkwb0lk4n73xs/artifacts
I apparently discovered the cause of the offset. Because fonts on a 4K display are microscopic, I scale the font size in Control Panel to 150%. If I reset the fonts to 100%, the MyPaint offset issue does not occur. I've run about six other drawing apps, and MyPaint is the only app to have a problem with the font scaling.
In the GTK Demo Drawing Space app with font scaling at 150%, touching the graphics tablet with the pen causes two dots to appear--one under the pen tip and another offset to the left. Move the pen and all markings occur under the pen tip. The distance between the first two dots decreases as the initial pen touch moves to the right. So it appears as though GTK does not immediately handle the font scaling correctly, causing the single offset dot, but does correct. With font scaling at 100%, the single left-offset dot does not appear and all markings are under the pen tip.
I still have the issue with MyPaint not recognizing my Wacom Intuos graphics tablet. Running another drawing app first and then running MyPaint usually gets MyPaint to recognize the tablet.
I just got MyPaint on my new Win10 4K laptop, and plugged in my old Intous2. I also have the offset problem with MyPaint. Using the debug, MyPaint doesn't seem to know I have the tablet.
Krita and SketchBook work fine.
I also have this issue on Windows 10 using a 4K display. As mentioned by @calwas, I also use "Scale and layout" settings (font scaling) of 150% for readability. Setting it to 100% fixes the issue!
The last settings on this screenshot is the issue: https://i.imgur.com/kPhbhKo.jpg
The farther from the right side of the screen you go, the more the offset increases (for me at least): https://i.imgur.com/YV5eWtq.jpeg. This is me drawing on the right side of my screen – offset between cursor and stroke becomes smaller: https://i.imgur.com/TIcYlz1.jpeg
This issue is pretty old, any updates on this?
PS: I also use two monitors and my 4K display is positioned on the right of my secondary monitor.
@MichelArendt Actually I'm investigating this issue right now. It's a nasty and elusive bugger.
Update: Two GTK merge updates address the issue of MyPaint not recognizing pen stylus: #2458 and #2469.
The issue of the drawing offset is described in GTK issue #734. One workaround is to set all monitors to the same scaling value. They don't have to be 100%, but they have to be the same. I understand the cause of the offset issue--it is due to the way the GDK calculates the coordinate positions. GDK assumes all monitors have the same scaling value. Unfortunately, this behavior seems deeply built into the workings of GDK. I have not been able to find a feasible solution.
@calwas Is there any update on this issue? I am still not able to use MyPaint because of this issue. I have on 4k display (3840x2160) and one Ultrawide (3440x1440) where my 4k display is set to 200% scaling. Once I set both the displays too 100% scaling it works perfectly fine, but than the 4k display is unusable.
@bramhoven The workaround is to set all monitors to the same scaling value--any value, it doesn't have to be 100%. If you can set both monitors to 200%, even if temporarily when running MyPaint, everything should work.
The GTK behavior that is causing the issue is deeply ingrained in the technique GTK uses to calculate the cursor position. Fixing the issue would require a significant redesign. Given the complexity of the GTK code base and its fairly stable operation, plus GTK's support for Windows being secondary after Linux, the GTK owners seem reluctant to make changes to this area of the code.
On the "slim hope" front, a new GTK 4.0 was recently released which made significant changes to Windows screen processing. The possibility exists that this issue does not carry over into the updated code base. Running the 4.0 version of the gtk_demo test app should reveal whether the issue still exists in 4.0.
@calwas thanks for your quick update! If I have the time today, I will check if it still exists in GTK 4.0.
I'm having the same issue with the following setup in MyPaint 2.0:
- HP Elitebook X360, additional external Screen, Windows 10, Wacom Intuos M (driver 6.3.40.2)
- Mainscreen: 1920x1200, 100% scaling
- Laptop-Screen 1920x1080, 125% scaling
As stated in GTK issue 734, this can be fixed by exchanging libgdk with a newer version based on GTK 3.24.30.
Please integrate GTK 3.24.30 or newer into MyPaint.
Potential duplicate of #763