Modify

Opened 7 months ago

Closed 10 days ago

Last modified 4 days ago

#23392 closed defect (fixed)

[Patch] JOSM doesn't work well when not maximized

Reported by: GerdP Owned by: team
Priority: normal Milestone: 24.07
Component: Core Version:
Keywords: template_report Cc: gaben

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. start JOSM with clean home dir (JOSM opens in a non-maximized window)
  2. Open BING background layer

What is the expected result?

Empty data layer and side windows for tags, relations etc are visible with reasonable geometry

What happens instead?

The side windows are far too small, barely visible and a new user probably has no idea what to do.

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

Maybe this doesn't happen always. I noticed it first opening a BING layer in latest r18934, tried again with older versions and then tried with CTRL+N for a new data layer. Always saw the same problem.
After creating this ticket I am no longer able to reproduce with CTRL+N, but BING still works, so I changed the description. Hope you can reproduce.

Build-Date:2024-01-05 09:09:15
Revision:18934
Is-Local-Build:true

Identification: JOSM/1.5 (18934 SVN de) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 284 MB / 1753 MB (54 MB allocated, but free)
Java version: 1.8.0_272-b10, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: de_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djosm.dir.name=23362]
Dataset consistency test: No problems found

Attachments (4)

minimized.JPG (116.0 KB ) - added by GerdP 7 months ago.
23392-nag.JPG (66.8 KB ) - added by GerdP 7 months ago.
23392.patch (1.0 KB ) - added by GerdP 6 months ago.
possible fix for the ill-sized Nag panel
23392-2.patch (1.9 KB ) - added by GerdP 5 months ago.
use popup width, not screen width

Download all attachments as: .zip

Change History (28)

by GerdP, 7 months ago

Attachment: minimized.JPG added

comment:1 by GerdP, 7 months ago

Description: modified (diff)

comment:2 by GerdP, 7 months ago

Description: modified (diff)

comment:3 by GerdP, 7 months ago

Description: modified (diff)

comment:4 by stoecker, 7 months ago

Probably we should restrict the minimum size of the sidebar. Something like 100px or so.

comment:5 by GerdP, 7 months ago

That could be an easy work around but I think there must be a timing problem. My guess is that the code which calculates the geometry of the side bar runs parallel to the code which opens the background layer, and both change the layout of the windows. Unfortunately my Eclipse installation refuses to compile JOSM since some months, so I cannot debug anything right now.

Besides that: JOSM seems to open the background layer for lat=0,lon=0 at a low zoom, resulting in an a black background with an error message "Keine Kacheln auf dieser Zoomstufe". I think this is be very frustrating for newbies. Maybe JOSM could use a larger zoom or a "neutral" point on earth which shows some (interesting) data?

comment:6 by anonymous, 7 months ago

a "neutral" point on earth which shows some (interesting) data?

?? doesn't that conflict?

whoever used lat=0,lon=0, intentionally or not, already picked a rather neutral spot..

comment:7 by GerdP, 7 months ago

Yes, any other point on earth would probably cause trouble. My idea was to show an unpopulated area like desert that looks beautiful so that anybody understands that this is not his home area.
A black screen with an error messages doesn't say that and doesn't invite to continue.

in reply to:  4 comment:8 by taylor.smock, 7 months ago

Replying to stoecker:

Probably we should restrict the minimum size of the sidebar. Something like 100px or so.

This would be "easy" to do. See source:trunk/src/org/openstreetmap/josm/gui/MapFrame.java@18934:239#L237 .

Replying to GerdP

A black screen with an error messages doesn't say that and doesn't invite to continue.

Maybe geolocation? If the OS supports it anyway.

Replying to GerdP

Unfortunately my Eclipse installation refuses to compile JOSM since some months

I'm willing to help you troubleshoot, but I bet it will work after you run ant dist on the command line. It is probably the generated sources (I'm betting MapCSS) that are at issue, and the Eclipse project isn't "smart" enough to know that some packages are generated. I think this can be fixed via #8269.
EDIT: Poke me on #josm IRC so we don't spam this ticket.

Last edited 7 months ago by taylor.smock (previous) (diff)

comment:9 by GerdP, 7 months ago

Reg. my Eclipse installation: I updated Eclipse and started to immport JOSM project from scratch and got it working again. I think I did that ten times before but probably didn't do ir right. I am now able to compile and debug (at least the java 8 version).
I'll try again to debug this ticket tomorrow.

comment:10 by GerdP, 7 months ago

OK, reg. the too small side windows:
When I comment this line in AddImageryLayerAction

                AlignImageryPanel.addNagPanelIfNeeded(infoToAdd);

the layout is OK. Also, when I first add a new data layer and then a background image.
So, the additional panel at the top somehow corrupts the calculation of the layout. No idea where to fix that.

by GerdP, 7 months ago

Attachment: 23392-nag.JPG added

comment:11 by GerdP, 7 months ago

Description: modified (diff)

by GerdP, 6 months ago

Attachment: 23392.patch added

possible fix for the ill-sized Nag panel

comment:12 by taylor.smock, 6 months ago

Here is something else that works (with the default 1000w x 740h).

  • src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java b/src/org/openstreetmap/josm/gui/layer/AlignImageryPanel.java
    a b  
    9191        MapFrame map = MainApplication.getMap();
    9292        if (MainApplication.isDisplayingMapView() && showAgain.get() && !infoToAdd.isGeoreferenceValid()
    9393                && map.getTopPanel(AlignImageryPanel.class) == null) {
    94             double w = GuiHelper.getScreenSize().getWidth();
     94            double w = map.getWidth();
    9595            map.addTopPanel(new AlignImageryPanel(w > 1300, showAgain, infoToAdd));
    9696        }
    9797    }

comment:13 by GerdP, 6 months ago

I tried that also and it didn't help on my PC.

comment:14 by taylor.smock, 6 months ago

That's funny.
I hate it when things work on one OS and not on another. What happens if you set w to 0.0?

comment:15 by GerdP, 6 months ago

map.getwidth() returns 400 on my machine. That value is hardcoded, so I wonder how you can see a different result.

comment:16 by taylor.smock, 6 months ago

That isn't hardcoded. I think we just set it to 400 during initialization, and it hasn't updated yet.

Either way, I saw different behavior when I ensured that the w variable was less than 1300.

comment:17 by GerdP, 6 months ago

Different yes (two line vs. one line), but not good on Windows

by GerdP, 5 months ago

Attachment: 23392-2.patch added

use popup width, not screen width

comment:18 by GerdP, 5 months ago

Summary: JOSM doesn't work well when not maximized[Patch] JOSM doesn't work well when not maximized

comment:19 by gaben, 8 weeks ago

Cc: gaben added

Ahh, I saw this behaviour many times but never was able to reproduce.

comment:20 by taylor.smock, 11 days ago

Milestone: 24.07

@GerdP: Do you want to apply the patch?

comment:21 by GerdP, 11 days ago

Will do it tomorrow.

comment:22 by GerdP, 10 days ago

Resolution: fixed
Status: newclosed

In 19147/josm:

fix #23392: JOSM doesn't work well when not maximized

  • use SwingUtilities.invokeLater() for the AlignImageryPanel

comment:23 by gaben, 5 days ago

I don't know if it's related but I recently noticed the tab pressing could not always hide the toolbar :/

comment:24 by GerdP, 4 days ago

Any idea why the changes in r19147 could be related?

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.