import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import java.awt.Image;
import java.awt.Window;
import java.lang.reflect.*;
import javax.swing.*;
setTitle(name+" - TigerVNC");
setFocusable(false);
setFocusTraversalKeysEnabled(false);
- setIconImage(VncViewer.frameIcon);
+ if (VncViewer.os.startsWith("mac os x")) {
+ try {
+ Class appClass = Class.forName("com.apple.eawt.Application");
+ Method getApplication =
+ appClass.getMethod("getApplication", (Class[])null);
+ Object app = getApplication.invoke(appClass);
+ Class paramTypes[] = new Class[1];
+ paramTypes[0] = Image.class;
+ Method setDockIconImage =
+ appClass.getMethod("setDockIconImage", paramTypes);
+ setDockIconImage.invoke(app, VncViewer.logoImage);
+ } catch (Exception e) {
+ vlog.debug("Could not set OS X dock icon: " + e.getMessage());
+ }
+ } else {
+ setIconImage(VncViewer.frameIcon);
+ }
UIManager.getDefaults().put("ScrollPane.ancestorInputMap",
new UIDefaults.LazyInputMap(new Object[]{}));
sp = new JScrollPane();
} catch (Exception e) {
vlog.debug("Could not enable OS X 10.7+ full-screen mode: " +
e.getMessage());
-
}
}