Modify

Opened 2 months ago

Last modified 8 weeks ago

#18694 new defect

Wrongly rendered cursors on HiDPI screen

Reported by: johsin18 Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: template_report hidpi mouse cursor Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Start JOSM on a HiDPI screen (200% Windows scaling)
  2. New Layer
  3. Hover mouse over data layer and press Shift key (showing mouse cursor for "add to selection")

What is the expected result?

Mouse cursor with a dashed rectangle close to it, containing a little plus sign. Mouse arrow and rectangle have approximately the same size.

correct lo DPI cursor

What happens instead?

Mouse cursor with a dashed rectangle quite distant to it, containing a very tiny plus sign (very hard to see). The mouse arrow is larger than the rectangle.

faulty hi DPI cursor

Please provide any additional information below. Attach a screenshot if possible.

See attached screenshots for both cases (imagine the hi DPI cursor scaled by half). The behavior for other cursors with overlay is similar.
Disregard the few faulty pixel on the left in the high DPI mouse arrow. They are caused by the Windows-built-in Magnifier tool somehow.

I would like to fix this myself. However, I would need some explanations on the existing code.
Deep down in the cursor construction I get via

GuiSizesHelper.getSizeDpiAdjusted()

to

GuiSizesHelper.getScreenDPI()

which claims to return the "screen resolution in DPI".
However, unless for the unlikely case that the user sets "gui.scale" in the settings manually, it will always return 96, regardless of the actual screen resolution (and/or scaling), will it not?
Is getScreenDPI() buggy or do I misinterpret its function?

Revision:15592
Is-Local-Build:true
Build-Date:2020-02-09 18:52:27

Identification: JOSM/1.5 (15592 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1909 (18363)
Memory Usage: 290 MB / 2028 MB (127 MB allocated, but free)
Java version: 15-ea+6-123, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: \Display0 3200x1800
Maximum Screen Size: 3200x1800
VM arguments: [-Djosm.home=<josm.pref>, -Didea.launcher.port=57345, -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3\bin, -Dfile.encoding=UTF-8]
Program arguments: [--reset-preferences]
Dataset consistency test: No problems found

Last errors/warnings:
- W: Replacing existing preference file '<josm.pref>\preferences.xml' with default preference file.
- W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (2)

CorrectLoDpiCursor.png (380 bytes) - added by johsin18 2 months ago.
correct lo DPI cursor
FaultyHiDpiCursor.png (288 bytes) - added by johsin18 2 months ago.
faulty hi DPI cursor

Download all attachments as: .zip

Change History (6)

Changed 2 months ago by johsin18

Attachment: CorrectLoDpiCursor.png added

correct lo DPI cursor

Changed 2 months ago by johsin18

Attachment: FaultyHiDpiCursor.png added

faulty hi DPI cursor

comment:1 Changed 2 months ago by johsin18

Description: modified (diff)

comment:2 Changed 2 months ago by simon04

Keywords: hidpi added

comment:3 Changed 2 months ago by simon04

Keywords: mouse cursor added

comment:4 Changed 8 weeks ago by Don-vip

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to johsin18
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


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

 
Note: See TracTickets for help on using tickets.