Skip to content

Commit 2105c56

Browse files
committed
return true or false instead of hiding exception
1 parent 1cfbd9e commit 2105c56

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/processing/core/ThinkDifferent.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,20 @@ static private Desktop getDesktop() {
133133
static native public void activate();
134134

135135
// Used by py5 to bring Sketch to the front
136-
static public void activateSketchWindow() {
136+
static public boolean activateSketchWindow() {
137137
try {
138138
String osVersion = System.getProperty("os.version");
139139
int versionNumber = Integer.parseInt(osVersion.split("\\.")[0]);
140140

141141
if (versionNumber >= 14) {
142142
activate();
143+
return true;
143144
} else if (versionNumber >= 10) {
144145
activateIgnoringOtherApps();
146+
return true;
145147
}
146148
} catch (Exception e) {
147-
// do nothing
149+
return false;
148150
}
149151
}
150152

0 commit comments

Comments
 (0)