Skip to content

Commit 558ddd3

Browse files
facchinmcmaglie
authored andcommitted
Don't restore sketch if last.sketch.location is out of display
`if ((screen.width != screenW) || (screen.height != screenH))` was making sure to reset every preference in case the display geometry changed. Unfortunately, on Windows 10, `Toolkit.getDefaultToolkit().getScreenSize()` reports only the primary monitor either if external display is connected or not. Fixes #9781
1 parent 6f943ea commit 558ddd3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: app/src/processing/app/Base.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,12 @@ private int[] retrieveSketchLocation(String index) {
621621
.get("last.sketch" + index + ".location");
622622
if (locationStr == null)
623623
return defaultEditorLocation();
624-
return PApplet.parseInt(PApplet.split(locationStr, ','));
624+
625+
int location[] = PApplet.parseInt(PApplet.split(locationStr, ','));
626+
if (location[0] > screen.width || location[1] > screen.height)
627+
return defaultEditorLocation();
628+
629+
return location;
625630
}
626631

627632
protected void storeRecentSketches(SketchController sketch) {

0 commit comments

Comments
 (0)