Modify

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#18769 closed defect (fixed)

[Patch RFC] Each time I open JOSM, the right pane gets slightly wider

Reported by: blackboxlogic@… Owned by: team
Priority: normal Milestone: 20.03
Component: Core Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Run JOSM by clicking on a .osm file
  2. Note the width of the right pane (the portion of the window holding "Layers" and "Tags/Memberships" etc)
  3. Close JOSM
  4. Run JOSM by clicking on a .osm file
  5. Note that the width of the right pane is about 10 pixels wider
  6. Repeat many times, the portion of your screen allocated to map gets smaller and smaller and smaller.

What is the expected result?

I expect the layout of JOSM to not change unless changed by the user.

What happens instead?

The right pane gets wider each time I close and open JOSM, eventually taking up a majority of the screen.

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

My work flow involves opening and closing JOSM many times which makes this issue worse. That's partly my fault, but still... it shouldn't do that.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-01-02 22:34:59 +0100 (Thu, 02 Jan 2020)
Build-Date:2020-01-02 21:52:31
Revision:15628
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15628 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1809 (17763)
Memory Usage: 247 MB / 989 MB (105 MB allocated, but free)
Java version: 1.8.0_241-b07, Oracle Corporation, Java HotSpot(TM) Client VM
Screen: \Display0 3840x2160
Maximum Screen Size: 3840x2160
Program arguments: [Thomaston/Subject.osm, Thomaston/Reference.osm, Thomaston/Conflated.Create.osm, Thomaston/Conflated.Modify.osm]
Dataset consistency test: No problems found

Plugins:
+ measurement (35248)

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.

Attachments (1)

18769.patch (1.1 KB) - added by GerdP 3 months ago.

Download all attachments as: .zip

Change History (24)

comment:1 in reply to:  description Changed 3 months ago by Don-vip

Replying to blackboxlogic@…:

Screen: \Display0 3840x2160
Maximum Screen Size: 3840x2160

You have an hidpi screen, Java 8 does not support those correctly. Could you please test with Java 13? https://adoptopenjdk.net/?variant=openjdk13&jvmVariant=hotspot

comment:2 Changed 3 months ago by Don-vip

Owner: changed from team to blackboxlogic@…
Status: newneedinfo

comment:3 Changed 3 months ago by anonymous

Thank you.
I have updated JOSM to latest, installed OpenJDK 13 and changed the %JAVA_HOME% environment variable to point to it.

When I open a console and run
java -version
I get
openjdk version "13.0.2" 2020-01-14

When I run
C:\Program Files (x86)\JOSM\josm-tested.jar
The program is visually improved in many ways (layout, font etc)
In Help -> About -> Info
Java Version is 13
In Help -> About -> Installation Details
%JAVA_HOME% points to OpenJDK 13
<java.home> points to OpenJDK 13

When I run
C:\Program Files (x86)\JOSM\josm.exe
The program is visually poor in many ways
In Help -> About -> Info
Java Version is 8
In Help -> About -> Installation Details
%JAVA_HOME% points to OpenJDK 13
<java.home> points to java 8

Do you know how to have JOSM use OpenJDK 13 when I run the josm.exe?
Or where <java.home> is stored? I didn't find it in \preferences.xml or the registry

comment:4 Changed 3 months ago by GerdP

I think the easiest way is to create a small *.bat or *.cmd file containing the set statements and starting JOSM via this script.

comment:5 Changed 3 months ago by anonymous

That doesn't help when I open an .osm file, which the operating system has associated with josm.exe
Any idea what makes josm.exe target java 8 still? Or should that be a separate ticket?

comment:6 Changed 3 months ago by GerdP

Did you also change the system environment variable PATH to point to the new jre?

comment:7 Changed 3 months ago by GerdP

BTW: I've associated my josm.cmd with *.osm.

comment:8 Changed 3 months ago by anonymous

My user's variables don't have any mention of java.
My system variables had java 8 in PATH, but I removed it and restarted my computer.

PATH is now:
C:\Program Files\AdoptOpenJDK\jdk-13.0.2.8-hotspot\bin;
%SystemRoot%\system32;
%SystemRoot%;
... etc

josm.exe still runs with java 8.

comment:9 Changed 3 months ago by GerdP

When both PATH and JAVA_HOME are correctly set I don't know how josm.exe should find the old version. I never use the installer.
Maybe https://josm.openstreetmap.de/wiki/Download#Mswindowswrapper helps?

comment:10 Changed 3 months ago by anonymous

I'm keeping a record of what I'm trying, in case anyone follows in my footseps.

Research:
https://github.com/openstreetmap/josm/blob/8a25032907bd22609198210c2a849d081f59feae/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java#L232
https://github.com/openstreetmap/josm/blob/c143bf6676b03b49eab4f73fa1097b9ba237d7b2/src/org/openstreetmap/josm/tools/Utils.java#L1370
https://docs.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties%28%29
https://stackoverflow.com/a/4440223/1521988

Changes:
Start -> Configure Java -> Java -> View -> Find
C:\Program Files\AdoptOpenJDK\jdk-13.0.2.8-hotspot\
Next -> Finish -> Enable only that one -> Ok -> Apply -> Ok -> Restart computer

comment:11 Changed 3 months ago by anonymous

that didn't work.

comment:12 Changed 3 months ago by anonymous

The original issue persists as reported when using OpenJDK 13.
Here are updated application metrics:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-02-26 10:50:27 +0100 (Wed, 26 Feb 2020)
Revision:15937
Build-Date:2020-02-26 09:52:41
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (15937 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1809 (17763)
Memory Usage: 551 MB / 4068 MB (279 MB allocated, but free)
Java version: 13.0.2+8, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Screen: \Display0 3840x2160
Maximum Screen Size: 3840x2160
Program arguments: [Topsham/Subject.osm, Topsham/Reference.osm, Topsham/Conflated.Create.osm, Topsham/Conflated.Modify.osm, Topsham/Conflated.Review.osm]
Dataset consistency test: No problems found

Plugins:
+ measurement (35248)

Last errors/warnings:
- W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'

comment:13 Changed 3 months ago by Don-vip

Owner: changed from blackboxlogic@… to team
Status: needinfonew

comment:14 Changed 3 months ago by GerdP

Owner: changed from team to GerdP

I can reproduce the problem on my system.

Changed 3 months ago by GerdP

Attachment: 18769.patch added

comment:15 Changed 3 months ago by GerdP

Milestone: 20.03
Owner: changed from GerdP to team
Summary: Each time I open JOSM, the right pane gets slightly wider[Patch RFC] Each time I open JOSM, the right pane gets slightly wider

Please review the small patch. It corrects the calculation of the preference value toggleDialogs.width, but I don't know why I have to subtract 1 to get the old result:
In addition I've added code to remember the width whenever the last layer is closed so that the splash screen appears.
Without this, the width is only remembered when you close JOSM while a layer is open.

Last edited 3 months ago by GerdP (previous) (diff)

comment:16 Changed 3 months ago by Hb---

You may want to start with the option josm.exe --l4j-debug to produce a log launch4j.log. josm.exe and josm-tested.jar need to be in a directory open for file creating and writing. Otherwise josm.exe could not create a file.

comment:17 Changed 3 months ago by blackboxlogic@…

Side note, I figured out my java version issue:

Fix:

  • Download the OpenJDK 13 JRE (NOT JDK)
  • Select the installer option to write registry keys

Going forward, I suggest 2 changes to launch4j.xml

  • <jdkPreference>preferJre</jdkPreference>
    • should be: <jdkPreference>preferJdk</jdkPreference>
    • Will take a JDK over a JRE
  • <path></path>
    • should be: <path>%JAVA_HOME%</path>
    • Will negate the need to have registry keys, which are not always there for OpenJDK

Would it be helpful to make a new ticket with these suggestion?

comment:18 in reply to:  17 Changed 3 months ago by skyper

Replying to blackboxlogic@…:

...
Would it be helpful to make a new ticket with these suggestion?

Yes, please.

comment:19 Changed 3 months ago by GerdP

Any comments on the patch? See comment:15

comment:20 Changed 3 months ago by Don-vip

I don't see anything suspicious in your patch, go ahead.

comment:21 Changed 3 months ago by Don-vip

@Gerd, can you please commit your patch?

comment:22 Changed 3 months ago by GerdP

Resolution: fixed
Status: newclosed

In 16132/josm:

fix #18769: Each time I open JOSM, the right pane gets slightly wider
Correct the calculation of the preference value toggleDialogs.width

comment:23 Changed 3 months ago by GerdP

@Vincent: Sorry, did not see comment:20 before

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.