On my cross-platform SWT Java application, I’m using TrayItem’s setImages() function to set the dock and status bar icon. The icon is a 128×128 transparent PNG. The status and tray icons are appropriately clipped on both Windows and Linux distributions, but on the Mac I have problems that make the status bar icon appear with strange padding on both sides like this:

It’s strange to me that this is working on all other platforms but the Mac. For instance, here is the same status bar icon without the problem on my Linux box:

Does anyone have any idea how to prevent this extra padding on the Mac?
I found the problem in SWT Cocoa sources.
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.