Commit e479c004 authored by William Jon McCann's avatar William Jon McCann

Don't try to change the window icon when the view changes

This avoids problems with using symbolic icons in the window titles
and with icons not updating.

https://bugzilla.gnome.org/show_bug.cgi?id=652212
parent 8e27c116
......@@ -345,12 +345,11 @@ viewed_file_changed_callback (NautilusFile *file,
}
} else {
/* TODO?
* why do we update title & icon at all in this case? */
* why do we update title at all in this case? */
g_object_unref (new_location);
}
nautilus_window_slot_update_title (slot);
nautilus_window_slot_update_icon (slot);
}
}
......@@ -1479,7 +1478,6 @@ update_for_new_location (NautilusWindowSlot *slot)
}
nautilus_window_slot_update_title (slot);
nautilus_window_slot_update_icon (slot);
if (slot == slot->window->details->active_slot) {
nautilus_window_sync_location_widgets (slot->window);
......
......@@ -507,47 +507,6 @@ nautilus_window_slot_update_title (NautilusWindowSlot *slot)
}
}
/* nautilus_window_slot_update_icon:
*
* Re-calculate the slot icon
* Called when the location or view or icon set has changed.
* @slot: The NautilusWindowSlot in question.
*/
void
nautilus_window_slot_update_icon (NautilusWindowSlot *slot)
{
NautilusWindow *window;
NautilusIconInfo *info;
const char *icon_name;
GdkPixbuf *pixbuf;
window = nautilus_window_slot_get_window (slot);
info = NAUTILUS_WINDOW_CLASS (G_OBJECT_GET_CLASS (window))->get_icon (window, slot);
icon_name = NULL;
if (info) {
icon_name = nautilus_icon_info_get_used_name (info);
if (icon_name != NULL) {
/* Gtk+ doesn't short circuit this (yet), so avoid lots of work
* if we're setting to the same icon. This happens a lot e.g. when
* the trash directory changes due to the file count changing.
*/
if (g_strcmp0 (icon_name, gtk_window_get_icon_name (GTK_WINDOW (window))) != 0) {
gtk_window_set_icon_name (GTK_WINDOW (window), icon_name);
}
} else {
pixbuf = nautilus_icon_info_get_pixbuf_nodefault (info);
if (pixbuf) {
gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
g_object_unref (pixbuf);
}
}
g_object_unref (info);
}
}
void
nautilus_window_slot_set_content_view_widget (NautilusWindowSlot *slot,
NautilusView *new_view)
......
......@@ -123,7 +123,6 @@ GType nautilus_window_slot_get_type (void);
NautilusWindowSlot * nautilus_window_slot_new (NautilusWindow *window);
void nautilus_window_slot_update_title (NautilusWindowSlot *slot);
void nautilus_window_slot_update_icon (NautilusWindowSlot *slot);
void nautilus_window_slot_set_query_editor_visible (NautilusWindowSlot *slot,
gboolean visible);
gboolean nautilus_window_slot_handle_event (NautilusWindowSlot *slot,
......
......@@ -1235,7 +1235,6 @@ nautilus_window_view_visible (NautilusWindow *window,
slot = l->data;
nautilus_window_slot_update_title (slot);
nautilus_window_slot_update_icon (slot);
}
nautilus_window_grab_focus (window);
......@@ -1879,6 +1878,7 @@ nautilus_window_init (NautilusWindow *window)
/* Set initial window title */
gtk_window_set_title (GTK_WINDOW (window), _("Files"));
gtk_window_set_icon_name (GTK_WINDOW (window), "system-file-manager");
gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), TRUE);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment