GNOME Bugzilla – Bug 68557
gtk_window_set_default_icon_list should set icon hints on the leader window
Last modified: 2013-10-06 05:42:53 UTC
Should set this icon on the leader window as the icon for the entire application. (Unfortunately, I don't think GDK exports a way to get the leader window anymore. Maybe we could do an internal "only GTK can use this" function. ;-))
Is there something in the wm-spec saying that the icon on the leader window is the icon for the app?
ICCCM, section 4.1.1: One of the windows (that is, the one the others point to) will be the group leader and will carry the group as opposed to the individual properties. Window managers may treat the group leader differently from other windows in the group. For example, group leaders may have the full set of decorations, and other group members may have a restricted set.
Icons should still be set per window. ICCCM 4.1.2.4. WM_HINTS Property ... Conventions: ... 2. The properties of the window group leader are those for the group as a whole (for example, the icon to be shown when the entire group is iconified). ...
> Icons should still be set per window. Of course, that isn't the point. The point is to have an icon that is the icon for the whole application, so that e.g. a button representing the whole app in the tasklist can use it.
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
I guess this is effectively an API bug, because we need the GDK API for GTK to use. Number of dups on #77941 suggests we really should have remembered to do this for 2.2, but wasn't marked API. doh.
Hmm, I wonder what gdk api would be best here. First of all, I notice that gdk merges the separate concepts of SM client leader and WM group leader; its probably not a problem in practise since window groups are so underused, but it is still conceivable to have a single SM client which has multiple window groups. But this is a different problem. So possible gdk apis: a) GdkWindow *gdk_window_get_group (GdkWindow *window) pro: nice symmetry with the the corresponding setter, but in practise, most toplevels will always have the default leader (cf above), so maybe b) GdkWindow *gdk_display_get_leader (GdkDisplay *display) is more convenient. But both of these have problems when new displays are opened after calling gtk_window_set_default_icon_list(). Who would be responsible for setting the default icons on the leader of the newly opened display ? So maybe it would be best to go for c) gdk_set_application_icon_list (GList *list) in analogy to g_set_application_name() which would have the disadvantage of storing a redundant copy of the default icon list, but would to set the icon on the group window like we do for the title with check_leader_window_title().
I have some sense that each GTK_WINDOW_TOPLEVEL should automatically be in its own group (at least by default). Or perhaps the right thing if we have a GnomeApp equivalent is for each GnomeApp-type window to be in its own group. Or maybe we should just break down and have an explicit group API (whether to overload GtkWindowGroup seems to be the open question) and do the above by default, but let it be overridden.
GTK+ doesn't merge the concept of group leader and client leader. The current API's in the two areas are: void gdk_window_set_group (GdkWindow *window, GdkWindow *leader); void gdk_set_sm_client_id (const gchar *sm_client_id); and they are completely unrelated. I discussed client IDs with Havoc at some length pre-2.2, and we agreed that there is no reason to ever need more than a single client ID per process. It's not hard to watch the list of currently open displays; there is a signal on the singleton GdkDisplayManager.
There should be a heirarchy of: gtk_window_set_default_icon_list (); gtk_window_group_set_icon_list (); gtk_window_set_icon_list (); where each window group (including the default) gets the iconlist from gtk_window_set_default_icon_list() unless explicitely set.
Didn't Matthias add such functions some time ago?
No I just made a start by making the leader window available from gdk.
closing old bugs