◐ Shell
reader mode source ↗
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
16 changes: 11 additions & 5 deletions core/src/processing/awt/PSurfaceAWT.java
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,11 @@ public void placeWindow(int[] location, int[] editorLocation) {

if (sketch.sketchFullScreen()) {
setFullFrame();
}

// Ignore placement of previous window and editor when full screen
if (!sketch.sketchFullScreen()) {
if (location != null) {
// a specific location was received from the Runner
// (applet has been run more than once, user placed window)
Expand Down Expand Up @@ -1105,6 +1106,11 @@ public void windowStateChanged(WindowEvent e) {
// This seems to be firing when dragging the window on OS X
// https://github.com/processing/processing/issues/3092
if (Frame.MAXIMIZED_BOTH == e.getNewState()) {
// Supposedly, sending the frame to back and then front is a
// workaround for this bug:
// http://stackoverflow.com/a/23897602
Expand All @@ -1127,7 +1133,7 @@ public void componentResized(ComponentEvent e) {
// http://dev.processing.org/bugs/show_bug.cgi?id=341
// This should also fix the blank screen on Linux bug
// http://dev.processing.org/bugs/show_bug.cgi?id=282
if (frame.isResizable()) {
// might be multiple resize calls before visible (i.e. first
// when pack() is called, then when it's resized for use).
// ignore them because it's not the user resizing things.
Expand Down
65 changes: 65 additions & 0 deletions core/src/processing/core/PApplet.java
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;
import java.util.zip.*;

Expand Down Expand Up @@ -897,6 +898,7 @@ public PSurface getSurface() {
int smooth = 1; // default smoothing (whatever that means for the renderer)

boolean fullScreen;
int display = -1; // use default
GraphicsDevice[] displayDevices;
// Unlike the others above, needs to be public to support
Expand Down Expand Up @@ -1066,6 +1068,15 @@ final public boolean sketchFullScreen() {
}


// // Could be named 'screen' instead of display since it's the people using
// // full screen who will be looking for it. On the other hand, screenX/Y/Z
// // makes things confusing, and if 'displayIndex' exists...
Expand Up @@ -1830,6 +1841,7 @@ public void fullScreen() {
if (!fullScreen) {
if (insideSettings("fullScreen")) {
this.fullScreen = true;
}
}
}
Expand All @@ -1839,6 +1851,7 @@ public void fullScreen(int display) {
if (!fullScreen || display != this.display) {
if (insideSettings("fullScreen", display)) {
this.fullScreen = true;
this.display = display;
}
}
Expand All @@ -1863,6 +1876,7 @@ public void fullScreen(String renderer) {
!renderer.equals(this.renderer)) {
if (insideSettings("fullScreen", renderer)) {
this.fullScreen = true;
this.renderer = renderer;
}
}
Expand All @@ -1879,13 +1893,58 @@ public void fullScreen(String renderer, int display) {
display != this.display) {
if (insideSettings("fullScreen", renderer, display)) {
this.fullScreen = true;
this.renderer = renderer;
this.display = display;
}
}
}


/**
* ( begin auto-generated from size.xml )
*
Expand Down Expand Up @@ -10320,6 +10379,12 @@ static public void runSketch(final String[] args,
}

sketch.showSurface();
sketch.startSurface();
/*
if (sketch.getGraphics().displayable()) {
11 changes: 11 additions & 0 deletions core/src/processing/javafx/PSurfaceFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ public void changed(ObservableValue<? extends Number> value,
sketch.setSize(newWidth.intValue(), sketch.height);
// draw();
fx.setSize(sketch.width, sketch.height);
}
});
heightProperty().addListener(new ChangeListener<Number>() {
Expand Down Expand Up @@ -304,6 +313,8 @@ public void start(final Stage stage) {
stage.setY(screenRect.getMinY());
stage.setWidth(screenRect.getWidth());
stage.setHeight(screenRect.getHeight());
}

Canvas canvas = surface.canvas;
Expand Down
26 changes: 21 additions & 5 deletions java/src/processing/mode/java/preproc/PdePreprocessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,12 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings

String[] sizeContents = matchMethod("size", searchArea);
String[] fullContents = matchMethod("fullScreen", searchArea);
// First check and make sure they aren't both being used, otherwise it'll
// throw a confusing state exception error that one "can't be used here".
if (sizeContents != null && fullContents != null) {
throw new SketchException("size() and fullScreen() cannot be used in the same sketch", false);
}

// Get everything inside the parens for the size() method
Expand Down Expand Up @@ -425,6 +427,20 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings
return info;
}

// Made it this far, but no size() or fullScreen(), and still
// need to pull out the noSmooth() and smooth(N) methods.
if (extraStatements.size() != 0) {
Expand Down Expand Up @@ -1472,4 +1488,4 @@ private String debugHiddenTokens(antlr.CommonHiddenStreamToken t) {
}
return sb.toString();
}
}
Toggle all file notes Toggle all file annotations