Check that cursor position has changed before calling

2004-04-02  Padraig O'Briain <padraig.obriain@sun.com>

	* gnome-theme-details.c (update_list_something): Check that cursor
	position has changed before calling gtk_tree_view_set_cursor.
	* gnome-theme-manager.c (update_settings_from_gconf): Check that
	cursor position has changed before calling gtk_tree_view_set_cursor.

	Fixes bug #131538.
This commit is contained in:
Padraig O'Briain 2004-04-02 14:33:59 +00:00 committed by Padraig O'Briain
parent 30b3cbb6d7
commit 80924cf2f0
3 changed files with 34 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2004-04-02 Padraig O'Briain <padraig.obriain@sun.com>
* gnome-theme-details.c (update_list_something): Check that cursor
position has changed before calling gtk_tree_view_set_cursor.
* gnome-theme-manager.c (update_settings_from_gconf): Check that
cursor position has changed before calling gtk_tree_view_set_cursor.
Fixes bug #131538.
2004-04-01 Jody Goldberg <jody@gnome.org> 2004-04-01 Jody Goldberg <jody@gnome.org>
* Release 2.6.0.3 * Release 2.6.0.3

View file

@ -508,8 +508,20 @@ update_list_something (GtkWidget *tree_view, const gchar *theme)
if (! strcmp (theme, theme_id)) if (! strcmp (theme, theme_id))
{ {
GtkTreePath *path; GtkTreePath *path;
GtkTreePath *cursor_path;
gboolean cursor_same = FALSE;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (tree_view), &cursor_path, NULL);
path = gtk_tree_model_get_path (model, &iter); path = gtk_tree_model_get_path (model, &iter);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); if (cursor_path && gtk_tree_path_compare (path, cursor_path) == 0)
cursor_same = TRUE;
gtk_tree_path_free (cursor_path);
if (!cursor_same)
{
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE);
}
gtk_tree_path_free (path); gtk_tree_path_free (path);
theme_found = TRUE; theme_found = TRUE;
} }

View file

@ -860,9 +860,20 @@ update_settings_from_gconf (void)
! strcmp (current_icon_theme, meta_theme_info->icon_theme_name)) ! strcmp (current_icon_theme, meta_theme_info->icon_theme_name))
{ {
GtkTreePath *path; GtkTreePath *path;
GtkTreePath *cursor_path;
gboolean cursor_same = FALSE;
gtk_tree_view_get_cursor (GTK_TREE_VIEW (tree_view), &cursor_path, NULL);
path = gtk_tree_model_get_path (model, &iter); path = gtk_tree_model_get_path (model, &iter);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE); if (cursor_path && gtk_tree_path_compare (path, cursor_path) == 0)
cursor_same = TRUE;
gtk_tree_path_free (cursor_path);
if (!cursor_same)
{
gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree_view), path, NULL, FALSE);
}
gtk_tree_path_free (path); gtk_tree_path_free (path);
custom_theme_found = FALSE; custom_theme_found = FALSE;