-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Labels
bugSomething isn't workingSomething isn't working
Description
To reproduce:
- Start Eclipse in a new workspace.
- Create a project.
- Create a
text.txtfile in the root of the new project. - Create a
text.mocfile. - Ctrl+Shift+R to open the "Open Resources" dialog.
- Type "test".
- Observe huge icons.
See screen recording:
open_resource_dialog_huge_icons.mp4
I can reproduce this on Linux, GTK3, with:
Eclipse SDK
Version: 2026-03 (4.39)
Build id: I20260113-1800
Seems like the icons of external editors are not scaled properly.
SWT snippet:
package test;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class TestProgram {
public static void main(String[] args) {
Display display = new Display();
Program program = Program.findProgram("moc");
ImageData imageData = program.getImageData();
Image image = new Image(display, imageData);
Shell shell = new Shell(display);
shell.setSize(100, 100);
shell.setLayout(new FillLayout());
shell.setText("Snippet 36");
Canvas c = new Canvas(shell, SWT.BORDER);
c.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
e.gc.drawImage(image, 0, 0);
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
And GTK3 snippet showing the height/width:
#include <gtk/gtk.h>
// gcc -g icon.c `pkg-config --cflags --libs gtk+-3.0` -o IconExample && ./IconExample
int
main (int argc, char **argv)
{
GtkWidget *window, *scrolled_window;
GtkListStore *liststore;
GtkTreeIter iter;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "delete_event", gtk_main_quit, NULL);
gtk_window_set_default_size(GTK_WINDOW(window), 200, 100);
scrolled_window = gtk_scrolled_window_new(NULL, NULL);
GIcon *gicon = g_icon_new_for_string("emacs", NULL);
GtkIconTheme *icon_theme = gtk_icon_theme_get_default();
GtkIconInfo *gicon_info = gtk_icon_theme_lookup_by_gicon(icon_theme, gicon, 16/*size*/, 0);
GdkPixbuf *pixbuf = gtk_icon_info_load_icon(gicon_info, NULL);
int height = gdk_pixbuf_get_height(pixbuf);
int width = gdk_pixbuf_get_width(pixbuf);
g_print("height=%d, width=%d\n", height, width);
gtk_container_add (GTK_CONTAINER (window), scrolled_window);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
$ gcc -g icon.c `pkg-config --cflags --libs gtk+-3.0` -o IconExample && ./IconExample
height=48, width=48
Varying the size parameter seems to make no difference. Though there are different icons available:
$ find /usr/share/icons/ -name "emacs.png"
/usr/share/icons/hicolor/16x16/apps/emacs.png
/usr/share/icons/hicolor/24x24/apps/emacs.png
/usr/share/icons/hicolor/32x32/apps/emacs.png
/usr/share/icons/hicolor/48x48/apps/emacs.png
/usr/share/icons/hicolor/128x128/apps/emacs.png
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working