[Xfce4-commits] [xfce/xfdesktop] 01/02: Fix icon placement when using "Arrange Desktop Icons" (Bug #11639)

noreply at xfce.org noreply at xfce.org
Sat Mar 7 18:37:01 CET 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit 70c0ba765f6b21c7cb1a9e1e16b4144795f7c70f
Author: Thaddaeus Tintenfisch <thad.fisch at gmail.com>
Date:   Thu Mar 5 11:08:50 2015 +0100

    Fix icon placement when using "Arrange Desktop Icons" (Bug #11639)
    
    Additional cosmetic fix:
      Sort volume icons after special ones
---
 src/xfdesktop-icon-view.c |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 4670ac3..b5248e8 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -1822,10 +1822,11 @@ xfdesktop_icon_view_sort_icons(XfdesktopIconView *icon_view)
 #ifdef ENABLE_FILE_ICONS
     GList *l = NULL;
     GList *special_icons = NULL;
+    GList *volume_icons = NULL;
     GList *folder_icons = NULL;
     GList *regular_icons = NULL;
-    gint16 row = 0;
-    gint16 col = -1; /* start at -1 because we'll increment it */
+    gint16 row = -1; /* start at -1 because we'll increment it */
+    gint16 col = 0;
 
     for(l = icon_view->priv->icons; l; l = l->next) {
         gint16 old_row, old_col;
@@ -1837,18 +1838,22 @@ xfdesktop_icon_view_sort_icons(XfdesktopIconView *icon_view)
             xfdesktop_grid_set_position_free(icon_view, old_row, old_col);
 
         /* Add it to the correct list */
-        if(XFDESKTOP_IS_SPECIAL_FILE_ICON(l->data) ||
-           XFDESKTOP_IS_VOLUME_ICON(l->data)) {
+        if(XFDESKTOP_IS_SPECIAL_FILE_ICON(l->data)) {
             special_icons = g_list_insert_sorted(special_icons,
                                                  l->data,
                                                  (GCompareFunc)xfdesktop_icon_view_compare_icons);
+        } else if(XFDESKTOP_IS_VOLUME_ICON(l->data)) {
+            volume_icons = g_list_insert_sorted(volume_icons,
+                                                l->data,
+                                                (GCompareFunc)xfdesktop_icon_view_compare_icons);
         } else if(XFDESKTOP_IS_FILE_ICON(l->data) &&
                   g_file_query_file_type(xfdesktop_file_icon_peek_file(l->data),
                                          G_FILE_QUERY_INFO_NONE,
-                                         NULL) == G_FILE_TYPE_DIRECTORY) {
+                                         NULL) == G_FILE_TYPE_DIRECTORY)
+        {
             folder_icons = g_list_insert_sorted(folder_icons,
-                                                 l->data,
-                                                 (GCompareFunc)xfdesktop_icon_view_compare_icons);
+                                                l->data,
+                                                (GCompareFunc)xfdesktop_icon_view_compare_icons);
         } else {
             regular_icons = g_list_insert_sorted(regular_icons,
                                                  l->data,
@@ -1858,6 +1863,7 @@ xfdesktop_icon_view_sort_icons(XfdesktopIconView *icon_view)
 
     /* Append the icons: special, folder, then regular */
     xfdesktop_icon_view_append_icons(icon_view, special_icons, &row, &col);
+    xfdesktop_icon_view_append_icons(icon_view, volume_icons, &row, &col);
     xfdesktop_icon_view_append_icons(icon_view, folder_icons, &row, &col);
     xfdesktop_icon_view_append_icons(icon_view, regular_icons, &row, &col);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list