From 397626fc7bf6b782fdf007c45129c0bf0061eaf3 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 25 Jun 2004 10:24:35 +0000 Subject: [PATCH] work around GTK+ bug #143270 (set the cursor on the selected model path 2004-06-25 Michael Natterer * app/gui/preferences-dialog.c (prefs_dialog_new): work around GTK+ bug #143270 (set the cursor on the selected model path instead of selecting the iter in the selection). Fixes random theme switching when selecting the "Theme" page. --- ChangeLog | 7 +++++++ app/dialogs/preferences-dialog.c | 10 +++++++++- app/gui/preferences-dialog.c | 10 +++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f14e738793..1b9548b318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-06-25 Michael Natterer + + * app/gui/preferences-dialog.c (prefs_dialog_new): work around + GTK+ bug #143270 (set the cursor on the selected model path + instead of selecting the iter in the selection). Fixes random + theme switching when selecting the "Theme" page. + 2004-06-25 Michael Natterer * app/core/gimpbrushgenerated.c: added properties for all brush diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 160dbf394c..c7b02c1482 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1259,7 +1259,15 @@ prefs_dialog_new (Gimp *gimp, if (GIMP_GUI_CONFIG (object)->theme && ! strcmp (GIMP_GUI_CONFIG (object)->theme, themes[i])) { - gtk_tree_selection_select_iter (sel, &iter); + GtkTreePath *path; + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), &iter); + + gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), path, + NULL, FALSE, 0.0, 0.0); + + gtk_tree_path_free (path); } } diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 160dbf394c..c7b02c1482 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -1259,7 +1259,15 @@ prefs_dialog_new (Gimp *gimp, if (GIMP_GUI_CONFIG (object)->theme && ! strcmp (GIMP_GUI_CONFIG (object)->theme, themes[i])) { - gtk_tree_selection_select_iter (sel, &iter); + GtkTreePath *path; + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), &iter); + + gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), path, + NULL, FALSE, 0.0, 0.0); + + gtk_tree_path_free (path); } }