#18769 closed defect (fixed)
[Patch RFC] Each time I open JOSM, the right pane gets slightly wider
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | normal | Milestone: | 20.03 |
Component: | Core | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Run JOSM by clicking on a .osm file
- Note the width of the right pane (the portion of the window holding "Layers" and "Tags/Memberships" etc)
- Close JOSM
- Run JOSM by clicking on a .osm file
- Note that the width of the right pane is about 10 pixels wider
- 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)
Change History (24)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
comment:3 by , 5 years ago
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 by , 5 years ago
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 by , 5 years ago
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 by , 5 years ago
Did you also change the system environment variable PATH to point to the new jre?
comment:8 by , 5 years ago
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 by , 5 years ago
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 by , 5 years ago
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:12 by , 5 years ago
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 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | needinfo → new |
by , 5 years ago
Attachment: | 18769.patch added |
---|
comment:15 by , 5 years ago
Milestone: | → 20.03 |
---|---|
Owner: | changed from | to
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.
comment:16 by , 5 years ago
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.
follow-up: 18 comment:17 by , 5 years ago
Side note, I figured out my java version issue:
- I had installed java 8 JRE previously.
- I had downloaded the OpenJDK 13 JDK, but josm.exe is configured to prefer a JRE
- I had correctly set the JAVA_HOME environment variable, but launch4j ignores JAVA_HOME
- While installing OpenJDK, I did not write java keys to registry
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 by , 5 years ago
Replying to blackboxlogic@…:
...
Would it be helpful to make a new ticket with these suggestion?
Yes, please.
Replying to blackboxlogic@…:
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