Skip to content

Commit

Permalink
fix #21961, fix #24142 - apply patch by Taylor - fix ISE with F11 usage
Browse files Browse the repository at this point in the history
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19314 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Feb 13, 2025
1 parent 6a29f91 commit 094754a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,25 @@ public void actionPerformed(ActionEvent e) {
toggleSelectedState(e);
Config.getPref().putBoolean("draw.fullscreen", isSelected());
notifySelectedState();
setMode();
safeSetMode();
}

/**
* To call if this action must be initially run at JOSM startup.
*/
public void initial() {
if (isSelected()) {
setMode();
safeSetMode();
}
}

protected void safeSetMode() {
try {
this.setMode();
} catch (Exception exception) {
// Something happened. Disable fullscreen.
Config.getPref().put("draw.fullscreen", null);
throw exception;
}
}

Expand Down

0 comments on commit 094754a

Please sign in to comment.