diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java index b96e68f8593..e68d86157cf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java @@ -515,7 +515,7 @@ public void setImage (Image image) { if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); this.image = image; if (parent != null) return; - if (display.dockImage == null) { + if (display.dockImage == null && !display.isBundledIconSet()) { display.application.setApplicationIconImage (image != null ? image.handle : null); } } @@ -552,7 +552,7 @@ public void setImages (Image [] images) { } this.images = images; if (parent != null) return; - if (display.dockImage == null) { + if (display.dockImage == null && !display.isBundledIconSet()) { if (images != null && images.length > 1) { Image [] bestImages = new Image [images.length]; System.arraycopy (images, 0, bestImages, 0, images.length); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java index abd8b2446dc..dc2caec0293 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java @@ -3441,6 +3441,17 @@ boolean isBundled () { return false; } +boolean isBundledIconSet () { + NSBundle mainBundle = NSBundle.mainBundle(); + if (mainBundle != null) { + NSDictionary info = mainBundle.infoDictionary(); + if (info != null) { + return info.objectForKey(NSString.stringWith("CFBundleIconName")) != null || info.objectForKey(NSString.stringWith("CFBundleIconFile")) != null ; + } + } + return false; +} + static boolean isValidClass (Class clazz) { String name = clazz.getName (); int index = name.lastIndexOf ('.');