[maemo-commits] [maemo-commits] r18416 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon May 18 13:38:06 EEST 2009
Author: kris
Date: 2009-05-18 13:38:04 +0300 (Mon, 18 May 2009)
New Revision: 18416

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtktreeview.c
Log:
2009-05-18  Kristian Rietveld  <kris at imendio.com>

	* gtk/gtktreeview.c (gtk_tree_view_button_release): When
	expanding/collapsing a node in Fremantle mode, do not compare
	the path with the cursor path.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2009-05-18 10:22:52 UTC (rev 18415)
+++ projects/haf/trunk/gtk+/ChangeLog	2009-05-18 10:38:04 UTC (rev 18416)
@@ -1,5 +1,11 @@
 2009-05-18  Kristian Rietveld  <kris at imendio.com>
 
+	* gtk/gtktreeview.c (gtk_tree_view_button_release): When
+	expanding/collapsing a node in Fremantle mode, do not compare
+	the path with the cursor path.
+
+2009-05-18  Kristian Rietveld  <kris at imendio.com>
+
 	Addresses: NB#112906 - Short cut keys are not working in legacy
 	applications
 

Modified: projects/haf/trunk/gtk+/gtk/gtktreeview.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtktreeview.c	2009-05-18 10:22:52 UTC (rev 18415)
+++ projects/haf/trunk/gtk+/gtk/gtktreeview.c	2009-05-18 10:38:04 UTC (rev 18416)
@@ -3632,28 +3632,40 @@
 
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_expand_row))
     {
-      GtkTreePath *path, *cursor_path;
+      GtkTreePath *path;
+      GtkRBTree *tree;
+      GtkRBNode *node = NULL;
 
       path = gtk_tree_row_reference_get_path (tree_view->priv->queued_expand_row);
-      cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
 
-      if (!gtk_tree_path_compare (cursor_path, path))
+      if (mode == HILDON_FREMANTLE)
         {
-	  GtkRBTree *tree;
-	  GtkRBNode *node;
+          /* We should not take the cursor into accont. */
+          _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+        }
+      else
+        {
+          GtkTreePath *cursor_path;
 
-	  _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+          cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
 
-	  if (!node->children)
-	    gtk_tree_view_real_expand_row (tree_view, path,
-					   tree, node, FALSE, TRUE);
-	  else
-	    gtk_tree_view_real_collapse_row (tree_view, path,
-					     tree, node, TRUE);
-	}
+          if (!gtk_tree_path_compare (cursor_path, path))
+            _gtk_tree_view_find_node (tree_view, path, &tree, &node);
 
+          gtk_tree_path_free (cursor_path);
+        }
+
+      if (node)
+        {
+          if (!node->children)
+            gtk_tree_view_real_expand_row (tree_view, path,
+                                           tree, node, FALSE, TRUE);
+          else
+            gtk_tree_view_real_collapse_row (tree_view, path,
+                                             tree, node, TRUE);
+        }
+
       gtk_tree_path_free (path);
-      gtk_tree_path_free (cursor_path);
 
       gtk_tree_row_reference_free (tree_view->priv->queued_expand_row);
       tree_view->priv->queued_expand_row = NULL;


More information about the maemo-commits mailing list