Setting window icons



Hmm, I posted some comments about this in bug #50079, but i thought i
should share them here for discussion.

So, Cut n Pasted:
I've been looking into the icon situation. There is currently three ways
to set the icon of a window. Using _NET_WM_ICON you can set an array of
32bit RGBA icons of different sizes, you can set an Bitmap and mask using
the WM hints, or you can set an icon_window and render the icon
yourself. There are also two ways to set the icon text, _NET_WM_ICON_NAME
(utf8) and WM_ICON_NAME.

I think exporting all this in Gtk will make the API complex and tightly
copuled with X. Instead i propose an API like this:

gtk_window_set_icons_list (GtkWindow *window, const gchar *name, GList *pixbufs);
gtk_window_set_icons (GtkWindow *window, const gchar *name, GdkPixbuf *icon1, ...);

This would set both _NET_WM_ICON_NAME and WM_ICON_NAME, set _NET_WM_ICON
to the list of pixbufs if supported, if not, set a icon_window which
renders the first pixbuf.

It could possibly also render the first pixbuf to 1bpp and set the icon
and mask. But 1bpp icons are so ugly I don't think anyone uses them
anyway.

This would need a new gdk call to set _NET_WM_ICON, returning false if not
supported. _NET_WN_ICON_NAME should probably be set by
gdk_window_set_icon_name(), will cook up a patch for that. 

Comments?

/ Alex






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]