diff --git a/app/src/processing/app/EditorState.java b/app/src/processing/app/EditorState.java index a55491af1..ffd43584f 100644 --- a/app/src/processing/app/EditorState.java +++ b/app/src/processing/app/EditorState.java @@ -53,6 +53,7 @@ public class EditorState { // int displayW, displayH; // String deviceName; // not really useful b/c it's more about bounds anyway Rectangle deviceBounds; + boolean isMaximized; /** @@ -173,6 +174,7 @@ public class EditorState { synchronized (editors) { final int OVER = 50; Editor lastOpened = editors.get(editors.size() - 1); + isMaximized = (lastOpened.getExtendedState() == Editor.MAXIMIZED_BOTH); editorBounds = lastOpened.getBounds(); editorBounds.x += OVER; editorBounds.y += OVER; @@ -183,6 +185,10 @@ public class EditorState { editorBounds.x = deviceBounds.x + (int) (Math.random() * (deviceBounds.width - defaultWidth)); editorBounds.y = deviceBounds.y + (int) (Math.random() * (deviceBounds.height - defaultHeight)); } + if (isMaximized) { + editorBounds.width = defaultWidth; + editorBounds.height = defaultHeight; + } } } } @@ -204,6 +210,9 @@ public class EditorState { if (dividerLocation != 0) { editor.setDividerLocation(dividerLocation); } + if (isMaximized) { + editor.setExtendedState(Editor.MAXIMIZED_BOTH); + } }