Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

‎app/src/processing/app/Base.java

Lines changed: 6 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /