gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon
- Date: Tue, 03 Oct 2017 17:28:16 +0400
- From: Alexander Shaduri <ashaduri@xxxxxxxxx>
- Subject: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon
I have a HiDPI Screen with DPI set to 192, GDK_SCALE=2 and GDK_DPI_SCALE=-1.
I need to get an icon as a pixbuf for GtkIconView.
This is the code in gtkmm:
Glib::RefPtr<Gtk::IconTheme> default_icon_theme = Gtk::IconTheme::get_default();
Glib::RefPtr<Gdk::Pixbuf> icon = default_icon_theme->load_icon("drive-harddisk", 64, Gtk::IconLookupFlags(0));
Now matter how I try, I simply cannot get a non-blurry icon. It seems that
GTK+ looks up an icon of size 64, then scales it to 128. I'd like for it to
get a 128-size icon directly.
Specifying 128 as an argument results in a blurry icon of size 256.
Note that without GDK_SCALE=2 I can specify size 128 and get a sharp icon
(there are major artifacts in the GUI though).
I need to support GDK_SCALE=2.
I tried playing with "scale" argument, but that doesn't help.
Note that icons on buttons and in menu appear sharp.
Is there a way to get a sharp icon with gtk_icon_theme_load_icon?
gtk-list mailing list