set frame icon images for Java2D (dock and cmd-tab)

This commit is contained in:
Ben Fry
2015-06-03 17:03:49 -05:00
parent e9b4789926
commit 20926bd8a2
3 changed files with 14 additions and 0 deletions

View File

@@ -988,6 +988,12 @@ public class PSurfaceAWT extends PSurfaceNone {
frame.setIconImages(iconImages);
} catch (Exception e) { } // harmless; keep this to ourselves
} else {
// On OS X, set this for AWT surfaces, which handles the dock image
// as well as the cmd-tab image that's shown. Just one size, I guess.
URL url = PApplet.class.getResource("/icon/icon-512.png");
ThinkDifferent.setIconImage(Toolkit.getDefaultToolkit().getImage(url));
}
}

View File

@@ -22,6 +22,8 @@
package processing.core;
import java.awt.Image;
import com.apple.eawt.AppEvent.QuitEvent;
import com.apple.eawt.Application;
import com.apple.eawt.QuitHandler;
@@ -118,4 +120,9 @@ public class ThinkDifferent {
}
*/
}
static void setIconImage(Image image) {
application.setDockIconImage(image);
}
}

View File

@@ -1,5 +1,6 @@
0237 (3.0a10)
X retain original java.awt.Frame when it's in use
X set frame icon images for Java2D (dock and cmd-tab)
fixed earlier/can no longer reproduce
X strips when rendering spheres with lights and anti-aliasing