Matt McClinch wrote:

Here you go. I tested it in both single click mode and double click mode, and it works the same way in each. I didn't add any code for the single-click-timeout case, because I wouldn't know how to test it (or where to add it, for that matter). Is it a hidden option or something?

Matt

No wonder I didn't know what you were talking about. I hadn't updated libexo to the latest version. Here is a patch to the latest libexo that includes the single-click-timeout case. This makes both changes I mentioned, by the way.

Matt
Index: exo/exo-icon-view.c
===================================================================
--- exo/exo-icon-view.c	(revision 20834)
+++ exo/exo-icon-view.c	(working copy)
@@ -2140,20 +2140,17 @@
           else if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE &&
                    (event->state & GDK_SHIFT_MASK))
             {
-              /* check if the item is not already selected (otherwise do nothing) */
-              if (G_LIKELY (!item->selected))
-                {
-                  exo_icon_view_unselect_all_internal (icon_view);
+              if (!(event->state & GDK_CONTROL_MASK)) 
+                exo_icon_view_unselect_all_internal (icon_view);
 
-                  exo_icon_view_set_cursor_item (icon_view, item, cursor_cell);
-                  if (!icon_view->priv->anchor_item)
-                    icon_view->priv->anchor_item = item;
-                  else 
-                    exo_icon_view_select_all_between (icon_view,
-                                                      icon_view->priv->anchor_item,
-                                                      item);
-                  dirty = TRUE;
-                }
+              exo_icon_view_set_cursor_item (icon_view, item, cursor_cell);
+              if (!icon_view->priv->anchor_item)
+                icon_view->priv->anchor_item = item;
+              else 
+                exo_icon_view_select_all_between (icon_view,
+                                                  icon_view->priv->anchor_item,
+                                                  item);
+              dirty = TRUE;
             }
           else 
             {
@@ -7343,22 +7340,19 @@
       else if ((icon_view->priv->single_click_timeout_state & GDK_SHIFT_MASK) != 0
             && icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
         {
-          /* check if the item is not already selected (otherwise do nothing) */
-          if (G_LIKELY (!item->selected))
-            {
-              /* unselect all previously selected items */
-              exo_icon_view_unselect_all_internal (icon_view);
+          if (!(icon_view->priv->single_click_timeout_state & GDK_CONTROL_MASK))
+            /* unselect all previously selected items */
+            exo_icon_view_unselect_all_internal (icon_view);
 
-              /* select all items between the anchor and the prelit item */
-              exo_icon_view_set_cursor_item (icon_view, item, -1);
-              if (icon_view->priv->anchor_item == NULL)
-                icon_view->priv->anchor_item = item;
-              else 
-                exo_icon_view_select_all_between (icon_view, icon_view->priv->anchor_item, item);
+          /* select all items between the anchor and the prelit item */
+          exo_icon_view_set_cursor_item (icon_view, item, -1);
+          if (icon_view->priv->anchor_item == NULL)
+            icon_view->priv->anchor_item = item;
+          else 
+            exo_icon_view_select_all_between (icon_view, icon_view->priv->anchor_item, item);
 
-              /* selection was changed */
-              dirty = TRUE;
-            }
+          /* selection was changed */
+          dirty = TRUE;
         }
       else
         {
_______________________________________________
Thunar-dev mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/thunar-dev

Reply via email to