From b2f192faabe412adce79534e22efe9fb69ee40e2 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 21 Jul 2006 10:10:31 +0000 Subject: Rename /openembedded/ -> /meta/ git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- .../gtk+-2.6.4-1.osso7/gtktreeselection.c.diff | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff (limited to 'meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff') diff --git a/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff new file mode 100644 index 0000000000..5361f9b5d1 --- /dev/null +++ b/meta/packages/gtk+/gtk+-2.6.4-1.osso7/gtktreeselection.c.diff @@ -0,0 +1,91 @@ +--- gtk+-2.6.4/gtk/gtktreeselection.c 2004-11-20 01:18:38.000000000 +0200 ++++ gtk+-2.6.4/gtk/gtktreeselection.c 2005-04-06 16:19:38.186733096 +0300 +@@ -190,11 +190,28 @@ + GtkSelectionMode type) + { + GtkTreeSelectionFunc tmp_func; ++ + g_return_if_fail (GTK_IS_TREE_SELECTION (selection)); + + if (selection->type == type) + return; + ++ /* Hildon addition */ ++ if ((type == GTK_SELECTION_SINGLE) && ++ (selection->type == GTK_SELECTION_MULTIPLE || ++ selection->type == GTK_SELECTION_BROWSE)) ++ { ++ GtkTreePath *cursor_path; ++ ++ /* to successfully switch from multiple selection mode to single ++ selection, we must ensure that anchor exists and is selected ++ since otherwise gtk_tree_selection_select_path won't work anymore */ ++ if (gtk_tree_row_reference_valid (selection->tree_view->priv->cursor)) ++ { ++ cursor_path = gtk_tree_row_reference_get_path (selection->tree_view->priv->cursor); gtk_tree_selection_select_path (selection, cursor_path); ++ gtk_tree_path_free (cursor_path); ++ } ++ } + + if (type == GTK_SELECTION_NONE) + { +@@ -251,6 +268,20 @@ + } + + selection->type = type; ++ ++ /* Hildon addition */ ++ if (type == GTK_SELECTION_SINGLE) ++ { ++ GtkTreePath *path; ++ GtkTreeIter iter; ++ ++ /* reset cursor to the selected row */ ++ gtk_tree_selection_get_selected (selection, NULL, &iter); ++ path = gtk_tree_model_get_path (selection->tree_view->priv->model, ++ &iter); ++ gtk_tree_view_set_cursor (selection->tree_view, path, NULL, FALSE); ++ gtk_tree_path_free (path); ++ } + } + + /** +@@ -1319,10 +1350,10 @@ + return sensitive; + } + +-static gboolean +-row_is_selectable (GtkTreeSelection *selection, +- GtkRBNode *node, +- GtkTreePath *path) ++gboolean ++_gtk_tree_selection_is_row_selectable (GtkTreeSelection *selection, ++ GtkRBNode *node, ++ GtkTreePath *path) + { + GList *list; + GtkTreeIter iter; +@@ -1411,7 +1442,7 @@ + { + /* We only want to select the new node if we can unselect the old one, + * and we can select the new one. */ +- dirty = row_is_selectable (selection, node, path); ++ dirty = _gtk_tree_selection_is_row_selectable (selection, node, path); + + /* if dirty is FALSE, we weren't able to select the new one, otherwise, we try to + * unselect the new one +@@ -1528,8 +1559,13 @@ + if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) != select) + { + path = _gtk_tree_view_find_path (selection->tree_view, tree, node); +- selected = row_is_selectable (selection, node, path); ++ selected = _gtk_tree_selection_is_row_selectable (selection, node, path); + gtk_tree_path_free (path); ++ ++ /* if row is unselectable, allow unselection only */ ++ if (!selected && !select && ++ GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED)) ++ selected = TRUE; + } + + if (selected == TRUE) -- cgit v1.2.3-54-g00ecf