I found the problem in SWT Cocoa sources.
public void setImage (Image image) {
checkWidget ();
if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
super.setImage (image);
double /*float*/ width = 0;
if (image == null) {
view.setImage (null);
} else {
/*
* Feature in Cocoa. If the NSImage object being set into the view is
* the same NSImage object that is already there then the new image is
* not taken. This results in the view's image not changing even if the
* NSImage object's content has changed since it was last set into the
* view. The workaround is to temporarily set the view's image to null
* so that the new image will then be taken.
*/
NSImage current = view.image ();
if (current != null && current.id == image.handle.id) {
view.setImage (null);
}
view.setImage (image.handle);
if (visible) {
width = image.handle.size ().width + BORDER;
}
}
item.setLength (width);
}
The problem is on the line width = image.handle.size ().width + BORDER;
which just takes pure size of image (in your case it's 128 px). I didn't found any suitable workaround (I saw you post bug report on SWT bugzilla).
So only way to avoid this bug (for now) is to make your tray image smaller.