Skip to content

Commit b199e12

Browse files
committed
fix for linux d&d, also includes new java runtime
1 parent 4440715 commit b199e12

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

app/src/processing/app/Editor.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ public void windowActivated(WindowEvent e) {
243243
pain.setTransferHandler(new TransferHandler() {
244244

245245
public boolean canImport(JComponent dest, DataFlavor[] flavors) {
246-
// claim that we can import everything
247-
// TODO maybe ask only for file objects?
248246
return true;
249247
}
250248

@@ -265,13 +263,21 @@ public boolean importData(JComponent src, Transferable transferable) {
265263
}
266264
}
267265
} else if (transferable.isDataFlavorSupported(uriListFlavor)) {
266+
//System.out.println("uri list");
268267
String data = (String)transferable.getTransferData(uriListFlavor);
269268
String[] pieces = PApplet.splitTokens(data, "\r\n");
269+
//PApplet.println(pieces);
270270
for (int i = 0; i < pieces.length; i++) {
271-
if (!pieces[i].startsWith("#")) {
272-
if (sketch.addFile(new File(pieces[i]))) {
273-
successful++;
274-
}
271+
if (pieces[i].startsWith("#")) continue;
272+
273+
String path = null;
274+
if (pieces[i].startsWith("file:///")) {
275+
path = pieces[i].substring(7);
276+
} else if (pieces[i].startsWith("file:/")) {
277+
path = pieces[i].substring(5);
278+
}
279+
if (sketch.addFile(new File(path))) {
280+
successful++;
275281
}
276282
}
277283
}

build/linux/jre.tgz

9.78 MB
Binary file not shown.

0 commit comments

Comments
 (0)