Modify

Opened 8 years ago

Closed 4 years ago

#13173 closed defect (fixed)

Mouse pointer target offset

Reported by: anonymous Owned by: team
Priority: normal Milestone: 20.07
Component: Core Version:
Keywords: hidpi windows scaling mouse cursor location offset Cc: Klumbumbus, Basstoelpel

Description (last modified by Don-vip)

In 3840 x 2160 resolution I see that pointer and real target "point" is not exactly same place (bit up-left from cross hair center).
This is not big issue, but slows down a bit as need to re-adjust some points.


Attachments (9)

2016-07-20_11-57-17.jpg (10.9 KB ) - added by anonymous 8 years ago.
JOSM Screenshot.png (1.0 MB ) - added by thomas.barris@… 6 years ago.
JOSM screenshot in native solution
JOSM_Versatz.jpg (53.4 KB ) - added by Don-vip 5 years ago.
fix-13173-mouse-cursor-hotspot-offset-for-hidpi.patch (1.1 KB ) - added by johsin18 4 years ago.
Patch 1
status-report-for-hidpi.patch (1.9 KB ) - added by johsin18 4 years ago.
Patch adding HiDPI-related information to the status report.
offsetcursorjosm.png (550 bytes ) - added by 7rst1 4 years ago.
LinuxOffsetCursor
statusreport7rst1 (18.5 KB ) - added by 7rst1 4 years ago.
I guess you found out that the error is decimal scaling across all platform, so my status report probably isn't useful. Here it is anyways.
fix-hotspot-with-ui-scale.patch (4.8 KB ) - added by johsin18 4 years ago.
josm better cursor.png (7.5 KB ) - added by 7rst1 4 years ago.
Updated to 16769 and can confirm that the patch fixed it.

Download all attachments as: .zip

Change History (59)

by anonymous, 8 years ago

Attachment: 2016-07-20_11-57-17.jpg added

comment:1 by Don-vip, 8 years ago

Description: modified (diff)

comment:2 by Don-vip, 8 years ago

Keywords: hidpi added

comment:3 by bastiK, 7 years ago

Resolution: needinfo
Status: newclosed

Please reopen if this is still an issue with Java 9.

in reply to:  3 comment:4 by thomas.barris@…, 6 years ago

Replying to bastiK:

Please reopen if this is still an issue with Java 9.

Java 9 here. I have the same issue with several monitor constellations but all with highDPI. Right now with built-in display of a Surface Pro. Just tested Paint and there is no issue between position pointed to and position of a point painted.
The mouse offset to left-up is in all JOSM modes: selecting, drawing etc. and really annoying as you misclick quite often.

Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-07-29 00:41:59 +0200 (Sun, 29 Jul 2018)
Revision:14066
Build-Date:2018-07-29 01:32:17
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14066 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1803 (17134)
Memory Usage: 413 MB / 2048 MB (80 MB allocated, but free)
Java version: 9.0.1+11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 2736x1824
Maximum Screen Size: 2736x1824
Dataset consistency test: No problems found

Plugins:
+ buildings_tools (34212)
+ terracer (34109)
Last edited 6 years ago by Don-vip (previous) (diff)

comment:5 by anonymous, 6 years ago

Resolution: needinfo
Status: closedreopened

comment:6 by Don-vip, 6 years ago

Owner: changed from team to anonymous
Status: reopenedneedinfo

Java 9 is no longer supported. Please try with Java 10.

comment:7 by Don-vip, 6 years ago

Owner: changed from anonymous to thomas.barris@…

comment:8 by thomas.barris@…, 6 years ago

here we go, but it did not change anything.

Relative:URL: /trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2018-07-29 00:41:59 +0200 (Sun, 29 Jul 2018)
Revision:14066
Build-Date:2018-07-29 01:32:17
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14066 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1803 (17134)
Memory Usage: 308 MB / 2048 MB (116 MB allocated, but free)
Java version: 10.0.2+13, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 2736x1824
Maximum Screen Size: 2736x1824
Dataset consistency test: No problems found

Version 0, edited 6 years ago by thomas.barris@… (next)

comment:9 by Don-vip, 6 years ago

Can you please attach a screenshot with native resolution? I need to see how JOSM is rendered on your Surface Pro pixel by pixel.

comment:10 by Klumbumbus, 6 years ago

Cc: Klumbumbus added

by thomas.barris@…, 6 years ago

Attachment: JOSM Screenshot.png added

JOSM screenshot in native solution

comment:11 by thomas.barris@…, 6 years ago

screenshot attached as per request

comment:12 by anonymous, 6 years ago

Owner: changed from thomas.barris@… to anonymous
Status: needinfonew

comment:13 by Don-vip, 6 years ago

Owner: changed from anonymous to team

comment:14 by Don-vip, 6 years ago

Ticket #16849 has been marked as a duplicate of this ticket.

comment:15 by Don-vip, 6 years ago

Cc: Basstoelpel added
Keywords: windows scaling added

I can reproduce with the following steps:

  • close JOSM if running
  • change scale factor to 175% on main display (not secondary screen)
  • In the Advanced scaling page, enable the option 'Fix scaling for apps'
  • start JOSM on main display

Problem occurs both with 8u192 and 11.0.1

Last edited 6 years ago by Don-vip (previous) (diff)

comment:16 by Don-vip, 6 years ago

Keywords: mouse cursor location offset added
Priority: minornormal

comment:17 by Don-vip, 6 years ago

In 14342/josm:

see #9995, see #13173 - adjust symbol shapes size based on current DPI

comment:18 by Don-vip, 6 years ago

@Thomas: please try with r14342, I think the problem should be solved for you. If not please attach a new screenshot showing how it behaves when you create a node
@Basstoelpel: I don't think it will work for you, but it's worth a try too. Just a question: why do you scale your screen to 200%?

comment:20 by mani100, 5 years ago

I have a 32" 4k-Monitor, Windows10 scale 150% (how I do: my eyesight is bad).
JOSM 14375 java 1.8.0-191

Same problem with the node:


15.07.2020: My problem is fixed in Josm 16538 - thank you

Last edited 4 years ago by mani100 (previous) (diff)

by Don-vip, 5 years ago

Attachment: JOSM_Versatz.jpg added

comment:21 by johsin18, 4 years ago

JOSM works very well now on my HiDPI display, running on Windows 10.

However, I can still reproduce this little issue, even with JOSM revision 15592 and the latest JDK 14 Early Access.

The root cause seems to be this Java bug: https://bugs.openjdk.java.net/browse/JDK-8158776
(Unfortunately, I see no way to even comment on that one as a non-member.)

One workaround is to set the the scaling to "System" or "System (Advanced)" in the Windows program properties, but then you don't benefit from the HiDPI resolution anymore.

I have a patch for JOSM that works around this Java bug and fixes the problem, but I'm not sure it is portable. Who volunteers to test this and/or other potential fixes on his platform with varied settings (in particular MacOS, and also Linux)?

Last edited 4 years ago by johsin18 (previous) (diff)

comment:22 by johsin18, 4 years ago

Summary: Mouse pointer target offset[PATCH] Mouse pointer target offset

I have added a patch that fixes the problem. As I cannot test on other platforms, I restricted the change in behavior to Windows.

comment:23 by johsin18, 4 years ago

I have filed another bug to Java for this problem:
https://bugs.openjdk.java.net/browse/JDK-8238734

As it contains sample code in contrast to the old bug, they seem to be willing to fix the problem soonish (with Java 15).
My proposed patch would introduce the problem in the opposite direction if it was fixed on the Java side once. So I withdraw it hereby.
A forward-compatible patch (involving getBestCursorSize) would be possible, but is it worth it still?

comment:24 by johsin18, 4 years ago

Summary: [PATCH] Mouse pointer target offsetMouse pointer target offset

in reply to:  23 ; comment:25 by Don-vip, 4 years ago

Replying to johsin18:

I have filed another bug to Java for this problem:
https://bugs.openjdk.java.net/browse/JDK-8238734

Thanks a lot for creating this issue! I have a few questions/remarks:

  • I don't understand why you state the issue has been introduced in Java 9? The original Java bug, and this ticket, have been created against Java 8.
  • For next issues you can ask to Oracle to add the "josm-found" label. It allows to find JOSM-related issues in JBS.

A forward-compatible patch (involving getBestCursorSize) would be possible, but is it worth it still?

If you can find a way to fix the bug with or without the Java correction, it is worth it. Java versions fragmentation is a reality, it will takes years before we switch from Java 11 to Java 17 (we're still blocked at 8).

comment:26 by Don-vip, 4 years ago

Milestone: 20.02
Summary: Mouse pointer target offset[PATCH] Mouse pointer target offset

comment:27 by Don-vip, 4 years ago

Summary: [PATCH] Mouse pointer target offset[PATCH WIP] Mouse pointer target offset

in reply to:  25 ; comment:28 by johsin18, 4 years ago

Replying to Don-vip:

  • I don't understand why you state the issue has been introduced in Java 9? The original Java bug, and this ticket, have been created against Java 8.

I haven't stated that, but some Oracle employee. But indeed, my sample program works correctly on Java 8u241.
Anyway, HiDPI is supported only from Java 9 really, isn't it? So that's what I care about.

  • For next issues you can ask to Oracle to add the "josm-found" label. It allows to find JOSM-related issues in JBS.

I will.

A forward-compatible patch (involving getBestCursorSize) would be possible, but is it worth it still?

If you can find a way to fix the bug with or without the Java correction, it is worth it.

Okay, I will give it a try.

Java versions fragmentation is a reality, it will takes years before we switch from Java 11 to Java 17 (we're still blocked at 8).

You mean we have to stay compatible to Java 8? But the users are free to install a later version, aren't they? For HiDPI, IMHO we should recommend to users to use a recent Java version.

comment:29 by Don-vip, 4 years ago

Milestone: 20.0220.03

in reply to:  28 comment:30 by Don-vip, 4 years ago

Milestone: 20.0320.04

Replying to johsin18:

Anyway, HiDPI is supported only from Java 9 really, isn't it? So that's what I care about.

Yes, with JEP 263.

You mean we have to stay compatible to Java 8?

Yes, until we switch the codebase to Java 11, the program must compile and run with Java 8.

But the users are free to install a later version, aren't they? For HiDPI, IMHO we should recommend to users to use a recent Java version.

You're totally right. Especially on macOS with Retina displays, we advise everyone to use the latest stable version of Java.

I'm descoping this ticket from the current milestone to release 20.03 early to address #18798, as we receive a lot of duplicates.

comment:31 by johsin18, 4 years ago

Summary: [PATCH WIP] Mouse pointer target offset[PATCH] Mouse pointer target offset

#18694 has a patch that fixes also this problem.

comment:32 by Klumbumbus, 4 years ago

Milestone: 20.0420.05

Milestone renamed

comment:33 by simon04, 4 years ago

@johsin18, should we close this ticket in favour of #18694?

comment:34 by johsin18, 4 years ago

I suggest that we bring it the patch mentioned in #18694 first, then resolve this one.
BTW this one is targeted for 20.05, but #18694 only for 20.06.

comment:35 by johsin18, 4 years ago

Resolution: fixed
Status: newclosed

comment:36 by simon04, 4 years ago

Milestone: 20.05
Resolution: fixed
Status: closedreopened

comment:37 by simon04, 4 years ago

Resolution: duplicate
Status: reopenedclosed

Closed as duplicate of #18694.

comment:38 by 7rst1, 4 years ago

I still have this issue despite having updated to 16540. Is it certain that the patch for the issues with rendering in #18694 fixed this too? Is this only a patch for Windows, and so is there a separate issue for Linux users?

comment:39 by simon04, 4 years ago

Milestone: 20.06
Resolution: duplicate
Status: closedreopened

by johsin18, 4 years ago

Patch adding HiDPI-related information to the status report.

comment:40 by johsin18, 4 years ago

The patch definitely helped in my case, for Windows 10. The faulty JDK code making this workaround necessary looks platform-independent to me. Still, I cannot rule out that things behave differently on Linux.

So to get this solved, please answer the following questions:

  • Does the bug manifest right as before, or is it a bit better, or even worse? For which cursor type do you notice it?
    • Could you please send a screenshot of the haircross cursor and and node added when in this position, to showcase the offset? In case the screenshot does not show the cursor, consider making a physical picture.
  • What Linux desktop do you use? KDE? Gnome? Something else? How do you configure the HiDPI scaling there?
  • Do you have multiple screens? Are they all HiDPI? Which one is the "primary" screen?
    • I have attached a patch that extends the Status Report with some additional system information, which will help us nail down HiDPI issues in general.

by 7rst1, 4 years ago

Attachment: offsetcursorjosm.png added

LinuxOffsetCursor

comment:41 by 7rst1, 4 years ago

The cursor offset looks exactly the same. Notice it with every cursor type. I use Java 14.

I use KDE Plasma with global scaling set to 175% and JOSM scaling set to 1,5. I have two screens, one being 4K and the other being 1080. The 4K one is primary.
LinuxOffsetCursor

comment:42 by simon04, 4 years ago

In 16580/josm:

see #13173 - Add HiDPI information to status report (patch by johsin18, modified)

comment:43 by johsin18, 4 years ago

I can reproduce the problem also on Windows 10. The JOSM scaling of 1.5 makes it fail. I will try to fix this case as well.

comment:44 by simon04, 4 years ago

In 16584/josm:

see #13173 - PMD

by 7rst1, 4 years ago

Attachment: statusreport7rst1 added

I guess you found out that the error is decimal scaling across all platform, so my status report probably isn't useful. Here it is anyways.

comment:45 by simon04, 4 years ago

Summary: [PATCH] Mouse pointer target offsetMouse pointer target offset

comment:46 by simon04, 4 years ago

Related: #19360

by johsin18, 4 years ago

comment:47 by johsin18, 4 years ago

Summary: Mouse pointer target offset[PATCH] Mouse pointer target offset

So I have attached a patch that should fix the hotspot problem with custom UI scale.

However, the cursor images with overlays are still not correct for a custom UI scale. IMHO the code needs to be refactored heavily before this could be fixed. The factors that influence the size and the scaling of cursor images lead to a combinatorial explosion, which makes it untestable.

  • Hi-DPI scaling from the OS, via HiDPISupport.
  • Toolkit.getBestCursorSize()
  • gui.scale from the advanced preferences, via GuiSizesHelper
  • iconsize.cursor from the advanced preferences, directly in ImageProvider

comment:48 by simon04, 4 years ago

Milestone: 20.0620.07

comment:49 by simon04, 4 years ago

In 16764/josm:

see #13173 - Fix cursor hotspot for HiDPI (patch by johsin18, modified)

comment:50 by simon04, 4 years ago

Summary: [PATCH] Mouse pointer target offsetMouse pointer target offset

by 7rst1, 4 years ago

Attachment: josm better cursor.png added

Updated to 16769 and can confirm that the patch fixed it.

comment:51 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

Thank you all!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.