Skip to content

Commit 094754a

Browse files
author
stoecker
committed
fix #21961, fix #24142 - apply patch by Taylor - fix ISE with F11 usage
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19314 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 6a29f91 commit 094754a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,25 @@ public void actionPerformed(ActionEvent e) {
5656
toggleSelectedState(e);
5757
Config.getPref().putBoolean("draw.fullscreen", isSelected());
5858
notifySelectedState();
59-
setMode();
59+
safeSetMode();
6060
}
6161

6262
/**
6363
* To call if this action must be initially run at JOSM startup.
6464
*/
6565
public void initial() {
6666
if (isSelected()) {
67-
setMode();
67+
safeSetMode();
68+
}
69+
}
70+
71+
protected void safeSetMode() {
72+
try {
73+
this.setMode();
74+
} catch (Exception exception) {
75+
// Something happened. Disable fullscreen.
76+
Config.getPref().put("draw.fullscreen", null);
77+
throw exception;
6878
}
6979
}
7080

0 commit comments

Comments
 (0)