Opened 16 years ago
Closed 16 years ago
#2083 closed defect (fixed)
[PATCH] JOSM does not remember window size/state. Ignores taskbar (on windows) when determining size
Reported by: | BroadwayLamb | Owned by: | framm |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | unspecified | Version: | latest |
Keywords: | Cc: |
Description
MS Windows: Screen size ist not recorded. Not a problem but JOSM always starts full screen disregarding any existing tool/status-bars at the top of the screen. The same happens when maximizing the window.
Attachments (3)
Change History (14)
comment:1 by , 16 years ago
by , 16 years ago
Attachment: | Vollbildaufzeichnung 26.01.2009 105224.jpg added |
---|
comment:2 by , 16 years ago
Priority: | minor → major |
---|---|
Summary: | Program starts full screen overwriting tool bar at top of screen → JOSM does not remember window size/state. Ignores taskbar (on windows) when determining size |
This has probably been introduced by #1984 and is really annoying. This:
Index: src/org/openstreetmap/josm/gui/MainApplication.java
- if (!args.containsKey("no-fullscreen") && !args.containsKey("geometry") && Main.pref.get("gui.geometry") == null && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH)) + if (!args.containsKey("no-fullscreen") && !args.containsKey("geometry") && Main.pref.get("gui.geometry") == "" && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH))
makes JOSM remember its window size, but fails when the window was maximized.
("Ignoring malformed geometry 1163x808+121+-4" on my system).
This is actually two bugs:
- Fix remembering window size
- if no/malformed geometry available, either start maximized or at least do respect windows taskbar
comment:3 by , 16 years ago
Meh, Trac doesn't like patches.
Well open
src/org/openstreetmap/josm/gui/MainApplication.java
then replace
Main.pref.get("gui.geometry") == null
with
Main.pref.get("gui.geometry") == ""
but as mentioned: this doesn't work for maximized windows.
comment:5 by , 16 years ago
Sorry my original patch isn't perfect. I have attached a new patch that (I think)
addresses (some of) your gripes. I don't use Windoze so I can't test it on that
platform - please test and report back.
by , 16 years ago
Attachment: | josm-save-geometry-fix.patch added |
---|
comment:6 by , 16 years ago
Thanks for the fast fix! Here's what I found:
The patch fixes the "invalid geometry" thing when being exited while maximized. It does not restore maximized state though, but at least it's not placed under the task bar and it remembers all other features (size/position) when not maximized.
A fix that makes JOSM remember maximized state would be superb. It "fails" though when an invalid geometry is provided (i.e. placed under the task bar, like in the screenshot). Maybe defaulting to maximize, which was the previous behaviour iirc, would get rid of this, too. Users that don't resize the window thus won't even be bothered by it.
Keep up the good work, no need to be sorry :)
comment:7 by , 16 years ago
Good, that's progress. I will work on restoring to the maximised state. I think that
is a matter of detecting that the window is maximised and removing the gui.geometry
from the prefs.
Tell me, if the gui geometry is invalid, isn't the open behaviour the same
as it was before these patches were introduced (i.e. full screen size)?
by , 16 years ago
Attachment: | geometry-fix-2.patch added |
---|
comment:8 by , 16 years ago
Ok, I have added a further patch that (when combined with yesterday's patch) should
do the "right thing" if the window is maximised. Specifically, if the window is
maximised, the geometry in the preferences file is cleared on program exit
and so the next time the program is run it will have no geometry (unless the --geometry option is specified).
comment:9 by , 16 years ago
- Resizing it to a non-maximized state is remembered
- Maximized state is "remembered"
- If I provide an invalid geometry via --geometry it still 'hides' under the taskbar, but I guess that's acceptable (after all it's /me/ who provides the wrong geometry)
A random idea I had would be to replace if(x > 0) x=blah; with Math.max and Math.min which would chop of some lines of code :)
Great work!
comment:10 by , 16 years ago
Summary: | JOSM does not remember window size/state. Ignores taskbar (on windows) when determining size → [PATCH] JOSM does not remember window size/state. Ignores taskbar (on windows) when determining size |
---|
Bei mir ist es genau so.
Oberer Fensterrahmen von Josm nicht sichtbar, selbst wenn es bei letzten Programmstart geändert wurde, wenn die Taskleiste oben ist. (siehe Sceenshot)