Modify

Opened 4 years ago

Closed 9 hours ago

#13173 closed defect (duplicate)

[PATCH] Mouse pointer target offset

Reported by: anonymous Owned by: team
Priority: normal Milestone:
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 (4)

2016-07-20_11-57-17.jpg (10.9 KB) - added by anonymous 4 years ago.
JOSM Screenshot.png (1.0 MB) - added by thomas.barris@… 22 months ago.
JOSM screenshot in native solution
JOSM_Versatz.jpg (53.4 KB) - added by Don-vip 19 months ago.
fix-13173-mouse-cursor-hotspot-offset-for-hidpi.patch (1.1 KB) - added by johsin18 4 months ago.
Patch 1

Download all attachments as: .zip

Change History (40)

Changed 4 years ago by anonymous

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

comment:1 Changed 4 years ago by Don-vip

Description: modified (diff)

comment:2 Changed 4 years ago by Don-vip

Keywords: hidpi added

comment:3 Changed 3 years ago by bastiK

Resolution: needinfo
Status: newclosed

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

comment:4 in reply to:  3 Changed 22 months ago by thomas.barris@…

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 22 months ago by Don-vip (previous) (diff)

comment:5 Changed 22 months ago by anonymous

Resolution: needinfo
Status: closedreopened

comment:6 Changed 22 months ago by Don-vip

Owner: changed from team to anonymous
Status: reopenedneedinfo

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

comment:7 Changed 22 months ago by Don-vip

Owner: changed from anonymous to thomas.barris@…

comment:8 Changed 22 months ago by thomas.barris@…

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
Last edited 22 months ago by Don-vip (previous) (diff)

comment:9 Changed 22 months ago by Don-vip

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 Changed 22 months ago by Klumbumbus

Cc: Klumbumbus added

Changed 22 months ago by thomas.barris@…

Attachment: JOSM Screenshot.png added

JOSM screenshot in native solution

comment:11 Changed 22 months ago by thomas.barris@…

screenshot attached as per request

comment:12 Changed 22 months ago by anonymous

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

comment:13 Changed 22 months ago by Don-vip

Owner: changed from anonymous to team

comment:14 Changed 20 months ago by Don-vip

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

comment:15 Changed 20 months ago by Don-vip

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 20 months ago by Don-vip (previous) (diff)

comment:16 Changed 20 months ago by Don-vip

Keywords: mouse cursor location offset added
Priority: minornormal

comment:17 Changed 20 months ago by Don-vip

In 14342/josm:

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

comment:18 Changed 20 months ago by Don-vip

@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 Changed 19 months ago by mani100

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:


Last edited 19 months ago by Don-vip (previous) (diff)

Changed 19 months ago by Don-vip

Attachment: JOSM_Versatz.jpg added

comment:21 Changed 5 months ago by johsin18

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 5 months ago by johsin18 (previous) (diff)

Changed 4 months ago by johsin18

Patch 1

comment:22 Changed 4 months ago by johsin18

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 Changed 4 months ago by johsin18

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 Changed 4 months ago by johsin18

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

comment:25 in reply to:  23 ; Changed 3 months ago by Don-vip

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 Changed 3 months ago by Don-vip

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

comment:27 Changed 3 months ago by Don-vip

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

comment:28 in reply to:  25 ; Changed 3 months ago by johsin18

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 Changed 3 months ago by Don-vip

Milestone: 20.0220.03

comment:30 in reply to:  28 Changed 3 months ago by Don-vip

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 Changed 6 weeks ago by johsin18

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

#18694 has a patch that fixes also this problem.

comment:32 Changed 3 weeks ago by Klumbumbus

Milestone: 20.0420.05

Milestone renamed

comment:33 Changed 10 days ago by simon04

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

comment:34 Changed 7 days ago by johsin18

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 Changed 11 hours ago by johsin18

Resolution: fixed
Status: newclosed

comment:36 Changed 9 hours ago by simon04

Milestone: 20.05
Resolution: fixed
Status: closedreopened

comment:37 Changed 9 hours ago by simon04

Resolution: duplicate
Status: reopenedclosed

Closed as duplicate of #18694.

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.