I am trying to fix a problem I found with a Java application. It has a too low res icon. After reading the source of it I modified it to have a bigger icon. SWT uses the gtk_window_set_icon()
function of GTK to set the icon.
However, the high resolution icon is not used.
There is a work around of using a .desktop
file to have a nice icon described here. And others describe the problem on the Ubuntu forums.
So how can I have a nice icon without having to place a .desktop
file in the filesystem? Where should I report the bug for this? In which package is the code downscaling the icon that I intend to pass to the window manager?
I appreciate some help on this.
This can be reproduced with the following code:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Test {
public static void main(String[] args) {
Display display = new Display();
final int SIZE = 256;
Image large = new Image(display, SIZE, SIZE);
GC gc = new GC(large);
gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
gc.fillArc(0, 0, SIZE, SIZE, 45, 270);
gc.dispose();
Shell shell = new Shell(display);
shell.setImages(new Image[] { large });
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
large.dispose();
display.dispose();
}
}
.desktop
file to the appropriate places in the system. Moreover, I am actually using gtk_window_set_icon_list () which passes many icons to GTK, so the right (bigger) one should be chosen for ALT-TAB. – Felix Möller Jan 22 '13 at 06:45.desktop
file. – Felix Möller Jan 22 '13 at 17:44