[maemo-commits] [maemo-commits] r18464 - in projects/haf/branches/gtk+/upgrade-gtk-2-14: . debian gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri May 22 12:57:21 EEST 2009
Author: mitch
Date: 2009-05-22 12:57:16 +0300 (Fri, 22 May 2009)
New Revision: 18464

Modified:
   projects/haf/branches/gtk+/upgrade-gtk-2-14/ChangeLog.pre-2-14.maemo
   projects/haf/branches/gtk+/upgrade-gtk-2-14/debian/changelog
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcombobox.c
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcontainer.c
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkiconview.c
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtksettings.c
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktextview.c
   projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktreeview.c
Log:
Merge changes from trunk into this branch.



Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/ChangeLog.pre-2-14.maemo
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/ChangeLog.pre-2-14.maemo	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/ChangeLog.pre-2-14.maemo	2009-05-22 09:57:16 UTC (rev 18464)
@@ -1,3 +1,105 @@
+2009-05-22  Sven Herzberg  <herzi at lanedo.com>
+
+	Fixes: NB#105891 - Drawing lines support in text area widget
+
+	* gtk/gtktextview.c (gtk_text_view_class_init),
+	(gtk_text_view_paint): added a custom-background style property; see
+	the bugs for instructions how to use it
+
+2009-05-19  Kristian Rietveld  <kris at imendio.com>
+
+	Addresses: NB#115510 - Kinetic scrolling too sensitive.
+
+	* gtk/gtkiconview.c (gtk_icon_view_button_release): Actions are
+	only executed if the mouse has been released on the same row where
+	the mouse went down.
+
+2009-05-19  Kristian Rietveld  <kris at imendio.com>
+
+	Addresses: NB#114356 - NP-Audio: Clip used to launch CMS remains
+	highlighted along with the currently playing clip in NP List view.
+
+	* gtk/gtktreeview.c (gtk_tree_view_grab_notify): also free
+	a queued selection.
+
+2009-05-18  Claudio Saavedra  <csaavedra at igalia.com>
+
+	Released 2:2.12.12-1maemo17
+
+	* debian/changelog: Updates.
+
+2009-05-18  Kristian Rietveld  <kris at imendio.com>
+
+	Fixes: NB#111809 - word completion candidate is seen though focus is
+	moved to other widget
+
+	* gtk/gtktextview.c (gtk_text_view_focus_out): Remove !MAEMO_CHANGES
+	markers.  We do want to send focus-out to the IM context here to
+	lose the suggested word completion.
+
+2009-05-18  Kristian Rietveld  <kris at imendio.com>
+
+	Addresses: NB#115510 - Kinetic scrolling too sensitive.
+
+	* gtk/gtktreeview.c (gtk_tree_view_button_release): Actions are
+	only executed if the mouse has been released on the same row where
+	the mouse went down.
+
+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
+
+	* gtk/gtksettings.c: Revert change set 17997 committed on April 2nd
+	2009 (fix for NB#90356).  It disabled the menu accels also
+	functionally, which was not intended.
+
+2009-05-18  Kristian Rietveld  <kris at imendio.com>
+
+	Fixes: NB#116994 - clear private data item selection cannot be
+	toggled by tapping anywhere on the item
+
+	* gtk/gtktreeview.c (gtk_tree_view_button_press): treat clicks
+	on the tickmark in multiple selection mode as clicks on the last
+	column.
+
+2009-05-11  Claudio Saavedra  <csaavedra at igalia.com>
+
+	Released 2:2.12.12-1maemo16
+
+	* debian/changelog: Updates.
+
+2009-05-08  Kristian Rietveld  <kris at imendio.com>
+
+	Addresses: NB#110837 - Double line is appearing in synchronization
+	dialog.
+
+	* gtk/gtktreeview.c (gtk_tree_view_bin_expose): use "cell_blank"
+	detail when drawing the background for the empty space.
+
+2009-05-05  Sven Herzberg  <herzi at lanedo.com>
+
+	Addresses: NB#98705 - When forwarding a mail with multiple attachments
+	a new editor opens with To field overlapped
+
+	* gtk/gtkcontainer.c (container_scroll_focus_adjustments): make sure
+	we only clamp the adjustments when the values we got are actually
+	valid
+
+2009-04-30  Michael Natterer  <mitch at imendio.com>
+
+	Fixes the GTK+ part of: NB#103219 - Could not select Block speed
+	to 1 from the drop down box.
+
+	* gtk/gtkcombobox.c (gtk_combo_box_list_position): position the
+	combo popup inside the area defined by the _NET_WORKAREA property.
+
 2009-04-23  Claudio Saavedra  <csaavedra at igalia.com>
 
 	Released 2:2.12.12-1maemo15

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/debian/changelog
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/debian/changelog	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/debian/changelog	2009-05-22 09:57:16 UTC (rev 18464)
@@ -5,6 +5,27 @@
 
  -- Michael Natterer <mitch at imendio.com>  Fri, 24 Apr 2009 13:20:00 +0100
 
+gtk+2.0 (2:2.12.12-1maemo17) unstable; urgency=low
+
+  * Fixes: NB#111809 - word completion candidate is seen though focus is
+    moved to other widget
+  * Addresses: NB#115510 - Kinetic scrolling too sensitive.
+  * Addresses: NB#112906 - Short cut keys are not working in legacy
+    applications
+  * Fixes: NB#116994 - clear private data item selection cannot be toggled
+    by tapping anywhere on the item
+
+ -- Claudio Saavedra <csaavedra at igalia.com>  Mon, 18 May 2009 17:51:29 +0300
+
+gtk+2.0 (2:2.12.12-1maemo16) unstable; urgency=low
+
+  * Addresses: NB#103219 - Could not select Block speed to 1 from the drop down box
+  * Addresses: Addresses: NB#98705 - When forwarding a mail with multiple
+    attachments a new editor opens with To field overlapped
+  * Addresses: NB#110837 - Double line is appearing in synchronization dialog.
+
+ -- Claudio Saavedra <csaavedra at igalia.com>  Mon, 11 May 2009 17:15:32 +0300
+
 gtk+2.0 (2:2.12.12-1maemo15) unstable; urgency=low
 
   * Addresses: NB#108333 - Patch for GtkFrame to support new group title

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcombobox.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcombobox.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcombobox.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -1681,6 +1681,70 @@
 						  GTK_WIDGET (combo_box)->window);
   gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
+#ifdef MAEMO_CHANGES
+  {
+    GdkAtom  prop_type;
+    gint     prop_format;
+    gint     prop_length;
+    gint32  *work_area;
+
+#if 0
+    g_message ("%s: monitor %d: %d, %d (%d x %d)",
+               G_STRFUNC, private->monitor_num,
+               monitor.x, monitor.y,
+               monitor.width, monitor.height);
+#endif
+
+    if (gdk_property_get (gdk_screen_get_root_window (screen),
+                          gdk_atom_intern_static_string ("_NET_WORKAREA"),
+                          GDK_NONE,
+                          0, 16, FALSE,
+                          &prop_type, &prop_format, &prop_length,
+                          (guchar **) &work_area))
+      {
+        if (prop_format == 32 && prop_length == 16)
+          {
+            GdkRectangle work_rectangle;
+
+#if 0
+            g_message ("%s: work area: %d, %d (%d x %d)",
+                       G_STRFUNC,
+                       work_area[0], work_area[1],
+                       work_area[2], work_area[3]);
+#endif
+
+            work_rectangle.x      = work_area[0];
+            work_rectangle.y      = work_area[1];
+            work_rectangle.width  = work_area[2];
+            work_rectangle.height = work_area[3];
+
+            gdk_rectangle_intersect (&monitor, &work_rectangle, &monitor);
+
+#if 0
+            g_message ("%s: new monitor %d: %d, %d (%d x %d)",
+                       G_STRFUNC, private->monitor_num,
+                       monitor.x, monitor.y,
+                       monitor.width, monitor.height);
+#endif
+          }
+        else
+          {
+            g_warning ("%s: _NET_WORKAREA property has the wrong format!",
+                       G_STRFUNC);
+
+          }
+
+        g_free (work_area);
+      }
+    else
+      {
+        g_warning ("%s: _NET_WORKAREA property not found!",
+                   G_STRFUNC);
+
+      }
+  }
+#endif /* MAEMO_CHANGES */
+
   if (*x < monitor.x)
     *x = monitor.x;
   else if (*x + *width > monitor.x + monitor.width)

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcontainer.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcontainer.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkcontainer.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -1799,6 +1799,9 @@
       vadj = g_object_get_qdata (G_OBJECT (container), vadjustment_key_id);
       if (hadj || vadj) 
 	{
+#ifdef MAEMO_CHANGES
+          gboolean valid_coordinates = FALSE;
+#endif
 
 	  focus_child = container->focus_child;
 	  while (GTK_IS_CONTAINER (focus_child) && 
@@ -1807,6 +1810,9 @@
 	      focus_child = GTK_CONTAINER (focus_child)->focus_child;
 	    }
 	  
+#ifdef MAEMO_CHANGES
+          valid_coordinates =
+#endif
 	  gtk_widget_translate_coordinates (focus_child, container->focus_child, 
 					    0, 0, &x, &y);
 
@@ -1822,7 +1828,7 @@
 	       * to oscillate between two values (possibly HildonScrollArea is
 	       * causing that.) That should be enough for vkb resized dialogs.
 	       */
-	      if (!resize_update || focus_child->allocation.height < vadj->page_size)
+	      if (valid_coordinates && !resize_update || focus_child->allocation.height < vadj->page_size)
 #endif /* MAEMO_CHANGES */
 		gtk_adjustment_clamp_page (vadj, y, y + focus_child->allocation.height);
 	    }
@@ -1830,7 +1836,7 @@
 	  if (hadj)
 	    {
 #ifdef MAEMO_CHANGES
-	      if (!resize_update || focus_child->allocation.width < hadj->page_size)
+	      if (valid_coordinates && !resize_update || focus_child->allocation.width < hadj->page_size)
 #endif /* MAEMO_CHANGES */
 		gtk_adjustment_clamp_page (hadj, x, x + focus_child->allocation.width);
 	    }

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkiconview.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkiconview.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtkiconview.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -2350,6 +2350,7 @@
   GtkIconView *icon_view;
 #ifdef MAEMO_CHANGES
   HildonMode mode;
+  GtkIconViewItem *item = NULL;
 #endif /* MAEMO_CHANGES */
 
   icon_view = GTK_ICON_VIEW (widget);
@@ -2362,6 +2363,12 @@
                         "hildon-mode", &mode,
                         NULL);
 
+  if (mode == HILDON_FREMANTLE)
+    item = gtk_icon_view_get_item_at_coords (icon_view,
+                                             event->x, event->y,
+                                             FALSE,
+                                             NULL);
+
   if (icon_view->priv->queued_activate_item
       && mode == HILDON_FREMANTLE
       && icon_view->priv->hildon_ui_mode == HILDON_UI_MODE_NORMAL)
@@ -2371,9 +2378,12 @@
       gtk_icon_view_queue_draw_item (icon_view,
                                      icon_view->priv->queued_activate_item);
 
-      path = gtk_tree_path_new_from_indices (icon_view->priv->queued_activate_item->index, -1);
-      gtk_icon_view_item_activated (icon_view, path);
-      gtk_tree_path_free (path);
+      if (icon_view->priv->queued_activate_item == item)
+        {
+          path = gtk_tree_path_new_from_indices (icon_view->priv->queued_activate_item->index, -1);
+          gtk_icon_view_item_activated (icon_view, path);
+          gtk_tree_path_free (path);
+        }
 
       icon_view->priv->queued_activate_item = NULL;
     }
@@ -2382,31 +2392,36 @@
       && mode == HILDON_FREMANTLE
       && icon_view->priv->hildon_ui_mode == HILDON_UI_MODE_EDIT)
     {
-      GtkIconViewItem *item = icon_view->priv->queued_select_item;
+      GtkIconViewItem *select_item = icon_view->priv->queued_select_item;
 
       free_queued_select_item (icon_view);
 
-      if (icon_view->priv->selection_mode == GTK_SELECTION_SINGLE)
+      if (select_item == item)
         {
-          if (!item->selected)
+          if (icon_view->priv->selection_mode == GTK_SELECTION_SINGLE)
             {
-              gtk_icon_view_unselect_all_internal (icon_view);
+              if (!item->selected)
+                {
+                  gtk_icon_view_unselect_all_internal (icon_view);
 
-              item->selected = TRUE;
+                  item->selected = TRUE;
+                  gtk_icon_view_queue_draw_item (icon_view, item);
+
+                  g_signal_emit (icon_view,
+                                 icon_view_signals[SELECTION_CHANGED], 0);
+                }
+            }
+          else if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
+            {
+              item->selected = !item->selected;
               gtk_icon_view_queue_draw_item (icon_view, item);
 
-              g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
+              g_signal_emit (icon_view,
+                             icon_view_signals[SELECTION_CHANGED], 0);
             }
-        }
-      else if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
-        {
-          item->selected = !item->selected;
-          gtk_icon_view_queue_draw_item (icon_view, item);
 
-          g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
+          icon_view->priv->anchor_item = item;
         }
-
-      icon_view->priv->anchor_item = item;
     }
 #endif /* MAEMO_CHANGES */
 

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtksettings.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtksettings.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtksettings.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -790,11 +790,7 @@
                                              g_param_spec_boolean ("gtk-enable-mnemonics",
                                                                    P_("Enable Mnemonics"),
                                                                    P_("Whether labels should have mnemonics"),
-#ifdef MAEMO_CHANGES
-                                                                   FALSE,
-#else
                                                                    TRUE,
-#endif /* MAEMO_CHANGES */
                                                                    GTK_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_ENABLE_MNEMONICS);
@@ -811,11 +807,7 @@
                                              g_param_spec_boolean ("gtk-enable-accels",
                                                                    P_("Enable Accelerators"),
                                                                    P_("Whether menu items should have accelerators"),
-#ifdef MAEMO_CHANGES
-                                                                   FALSE,
-#else
                                                                    TRUE,
-#endif /* MAEMO_CHANGES */
                                                                    GTK_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_ENABLE_ACCELS);

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktextview.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktextview.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktextview.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -701,6 +701,14 @@
 							       P_("Color with which to draw error-indication underlines"),
 							       GDK_TYPE_COLOR,
 							       GTK_PARAM_READABLE));
+#ifdef MAEMO_CHANGES
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_boolean ("custom-background",
+                                                                 P_("Render a custom background"),
+                                                                 P_("Provide a hook for theme engines to render a custom background"),
+                                                                 FALSE,
+                                                                 GTK_PARAM_READABLE));
+#endif
   
   /*
    * Signals
@@ -4476,13 +4484,11 @@
 					keymap_direction_changed,
 					text_view);
 
-#ifndef MAEMO_CHANGES
   if (text_view->editable)
     {
       text_view->need_im_reset = TRUE;
       gtk_im_context_focus_out (GTK_TEXT_VIEW (widget)->im_context);
     }
-#endif /* !MAEMO_CHANGES */
 
   return FALSE;
 }
@@ -4538,6 +4544,9 @@
   GList *child_exposes;
   GList *tmp_list;
   GdkRegion *updates;
+#ifdef MAEMO_CHANGES
+  gboolean custom_background = FALSE;
+#endif
   
   text_view = GTK_TEXT_VIEW (widget);
 
@@ -4577,6 +4586,27 @@
           area->width, area->height);
 #endif
 
+#ifdef MAEMO_CHANGES
+  gtk_widget_style_get (widget,
+                        "custom-background", &custom_background,
+                        NULL);
+
+  if (custom_background)
+    {
+      gtk_paint_flat_box (widget->style,
+                          event->window,
+                          GTK_WIDGET_STATE (widget),
+                          GTK_SHADOW_NONE,
+                          area,
+                          widget,
+                          NULL,
+                          - text_view->xoffset,
+                          - text_view->yoffset,
+                          area->x + area->width + text_view->xoffset,
+                          area->y + area->height + text_view->yoffset);
+    }
+#endif
+
   child_exposes = NULL;
   gtk_text_layout_draw (text_view->layout,
                         widget,

Modified: projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktreeview.c
===================================================================
--- projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktreeview.c	2009-05-22 09:50:31 UTC (rev 18463)
+++ projects/haf/branches/gtk+/upgrade-gtk-2-14/gtk/gtktreeview.c	2009-05-22 09:57:16 UTC (rev 18464)
@@ -3010,6 +3010,23 @@
 	  break;
 	}
 
+#ifdef MAEMO_CHANGES
+      gtk_widget_style_get (widget,
+                            "hildon-mode", &mode,
+                            NULL);
+
+      if (mode == HILDON_FREMANTLE
+          && tree_view->priv->hildon_ui_mode == HILDON_UI_MODE_EDIT
+          && tree_view->priv->selection->type == GTK_SELECTION_MULTIPLE
+          && (gint)event->x < background_area.x + HILDON_TICK_MARK_SIZE)
+        {
+          GList *list;
+
+          list = (rtl ? g_list_first (tree_view->priv->columns) : g_list_last (tree_view->priv->columns));
+          column = list->data;
+        }
+#endif /* MAEMO_CHANGES */
+
       if (column == NULL)
 	{
 	  gtk_tree_path_free (path);
@@ -3087,10 +3104,6 @@
 	}
 
 #ifdef MAEMO_CHANGES
-      gtk_widget_style_get (widget,
-                            "hildon-mode", &mode,
-                            NULL);
-
       node_selected = GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED);
       node_is_selectable =
 	_gtk_tree_selection_row_is_selectable (tree_view->priv->selection,
@@ -3540,6 +3553,9 @@
   GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
 #ifdef MAEMO_CHANGES
   HildonMode mode;
+  gint new_y;
+  GtkRBTree *tree;
+  GtkRBNode *node;
 #endif /* MAEMO_CHANGES */
 
   if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
@@ -3559,26 +3575,39 @@
                         "hildon-mode", &mode,
                         NULL);
 
+  /* Get the node where the mouse was released */
+  new_y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, event->y);
+  if (new_y < 0)
+    new_y = 0;
+  _gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node);
+
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_select_row))
     {
       GtkTreePath *path;
+      GtkRBTree *select_tree;
+      GtkRBNode *select_node;
 
       path = gtk_tree_row_reference_get_path (tree_view->priv->queued_select_row);
+      _gtk_tree_view_find_node (tree_view, path,
+                                &select_tree, &select_node);
 
-      if (tree_view->priv->queued_ctrl_pressed)
+      if (tree == select_tree && node == select_node)
         {
-	  gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
-	  gtk_tree_view_real_toggle_cursor_row (tree_view);
-	  GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
-	}
-      else if (tree_view->priv->queued_shift_pressed)
-        {
-	  gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
-	  gtk_tree_view_real_select_cursor_row (tree_view, FALSE);
-	  GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
-	}
-      else
-	gtk_tree_view_real_set_cursor (tree_view, path, TRUE, TRUE);
+          if (tree_view->priv->queued_ctrl_pressed)
+            {
+              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
+              gtk_tree_view_real_toggle_cursor_row (tree_view);
+              GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
+            }
+          else if (tree_view->priv->queued_shift_pressed)
+            {
+              gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
+              gtk_tree_view_real_select_cursor_row (tree_view, FALSE);
+              GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
+            }
+          else
+            gtk_tree_view_real_set_cursor (tree_view, path, TRUE, TRUE);
+        }
 
       free_queued_select_row (tree_view);
       gtk_tree_path_free (path);
@@ -3589,12 +3618,11 @@
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_activate_row))
     {
       GtkTreePath *path;
+      GtkRBTree *activate_tree;
+      GtkRBNode *activate_node;
 
       path = gtk_tree_row_reference_get_path (tree_view->priv->queued_activate_row);
 
-      /* In normal-mode we will activate anyway, we do not care
-       * about the cursor.
-       */
       if (mode == HILDON_FREMANTLE
           && tree_view->priv->hildon_ui_mode == HILDON_UI_MODE_NORMAL)
         {
@@ -3608,33 +3636,20 @@
               tree_view->priv->highlighted_tree = NULL;
               tree_view->priv->highlighted_node = NULL;
             }
+        }
 
+      _gtk_tree_view_find_node (tree_view, path,
+                                &activate_tree, &activate_node);
+
+      /* Only emit activated if the mouse was released from the
+       * same row where the mouse was pressed.
+       */
+      if (tree == activate_tree && node == activate_node)
+        {
           gtk_tree_view_row_activated (tree_view, path,
                                        tree_view->priv->focus_column);
         }
-      else if (mode == HILDON_DIABLO)
-        {
-          gint new_y;
-          GtkRBTree *tree, *activate_tree;
-          GtkRBNode *node, *activate_node;
 
-          /* Get the node that is currently under the cursor */
-          new_y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, event->y);
-          if (new_y < 0)
-            new_y = 0;
-          _gtk_rbtree_find_offset (tree_view->priv->tree, new_y, &tree, &node);
-
-          _gtk_tree_view_find_node (tree_view, path,
-                                    &activate_tree, &activate_node);
-
-          /* Only emit activated if these match */
-          if (tree == activate_tree && node == activate_node)
-	    {
-	      gtk_tree_view_row_activated (tree_view, path,
-					   tree_view->priv->focus_column);
-	    }
-	}
-
       gtk_tree_path_free (path);
 
       gtk_tree_row_reference_free (tree_view->priv->queued_activate_row);
@@ -3643,28 +3658,48 @@
 
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_expand_row))
     {
-      GtkTreePath *path, *cursor_path;
+      GtkTreePath *path;
+      GtkRBTree *expand_tree;
+      GtkRBNode *expand_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.  We do check
+           * with the node where the mouse was released.
+           */
+          _gtk_tree_view_find_node (tree_view, path,
+                                    &expand_tree, &expand_node);
 
-	  _gtk_tree_view_find_node (tree_view, path, &tree, &node);
+          if (tree != expand_tree || node != expand_node)
+            expand_node = NULL;
+        }
+      else
+        {
+          GtkTreePath *cursor_path;
 
-	  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);
-	}
+          cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
 
+          if (!gtk_tree_path_compare (cursor_path, path))
+            _gtk_tree_view_find_node (tree_view, path,
+                                      &expand_tree, &expand_node);
+
+          gtk_tree_path_free (cursor_path);
+        }
+
+      if (expand_node)
+        {
+          if (!expand_node->children)
+            gtk_tree_view_real_expand_row (tree_view, path,
+                                           expand_tree, expand_node,
+                                           FALSE, TRUE);
+          else
+            gtk_tree_view_real_collapse_row (tree_view, path,
+                                             expand_tree, expand_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;
@@ -3677,11 +3712,17 @@
   if (gtk_tree_row_reference_valid (tree_view->priv->queued_tapped_row))
     {
       GtkTreePath *path;
+      GtkRBTree *tapped_tree;
+      GtkRBNode *tapped_node;
 
       path = gtk_tree_row_reference_get_path (tree_view->priv->queued_tapped_row);
-      g_signal_emit (tree_view, tree_view_signals[HILDON_ROW_TAPPED],
-                     0, path);
+      _gtk_tree_view_find_node (tree_view, path,
+                                &tapped_tree, &tapped_node);
 
+      if (tree == tapped_tree && node == tapped_node)
+        g_signal_emit (tree_view, tree_view_signals[HILDON_ROW_TAPPED],
+                       0, path);
+
       gtk_tree_path_free (path);
 
       gtk_tree_row_reference_free (tree_view->priv->queued_tapped_row);
@@ -5104,7 +5145,11 @@
                           GTK_SHADOW_NONE,
                           &event->area,
                           widget,
+#ifdef MAEMO_CHANGES
+                          "cell_blank",
+#else /* !MAEMO_CHANGES */
                           "cell_even",
+#endif /* !MAEMO_CHANGES */
                           0, tree_view->priv->height,
                           bin_window_width,
                           bin_window_height - tree_view->priv->height);
@@ -16825,6 +16870,7 @@
 	  tree_view->priv->queued_tapped_row = NULL;
 	}
 
+      free_queued_select_row (tree_view);
       free_queued_activate_row (tree_view);
 #endif /* MAEMO_CHANGES */
     }


More information about the maemo-commits mailing list