Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ('.');
Expand Down
Loading