[Xfce4-commits] <xfdesktop:master> Fix issues with icon resizing

Eric Koegel noreply at xfce.org
Mon Jan 27 16:18:01 CET 2014


Updating branch refs/heads/master
         to b730aad939db6b8ab5b99e5e4873c7540f7e2be0 (commit)
       from 983a5d601273ab2ef61bc437d655f999c45b8e01 (commit)

commit b730aad939db6b8ab5b99e5e4873c7540f7e2be0
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Jan 27 12:17:38 2014 +0300

    Fix issues with icon resizing

 src/xfdesktop-icon-view.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index 03c5acd..0bbfc3d 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -2680,10 +2680,10 @@ static void
 xfdesktop_setup_grids(XfdesktopIconView *icon_view)
 {
     gint xorigin = 0, yorigin = 0, width = 0, height = 0;
-    guint total_cells = (guint)icon_view->priv->nrows * icon_view->priv->ncols;
     gsize old_size, new_size;
     
-    old_size = total_cells * sizeof(XfdesktopIcon *);
+    old_size = (guint)icon_view->priv->nrows * icon_view->priv->ncols
+               * sizeof(XfdesktopIcon *);
     
     if(!xfdesktop_get_workarea_single(icon_view, 0,
                                       &xorigin, &yorigin,
@@ -2706,10 +2706,8 @@ xfdesktop_setup_grids(XfdesktopIconView *icon_view)
     DBG("CELL_SIZE=%0.3f, TEXT_WIDTH=%0.3f, ICON_SIZE=%u", CELL_SIZE, TEXT_WIDTH, ICON_SIZE);
     DBG("grid size is %dx%d", icon_view->priv->nrows, icon_view->priv->ncols);
 
-    /* recalculate */
-    total_cells = (guint)icon_view->priv->nrows * icon_view->priv->ncols;
-
-    new_size = total_cells * sizeof(XfdesktopIcon *);
+    new_size = (guint)icon_view->priv->nrows * icon_view->priv->ncols
+               * sizeof(XfdesktopIcon *);
 
     if(icon_view->priv->grid_layout) {
         icon_view->priv->grid_layout = g_realloc(icon_view->priv->grid_layout,
@@ -3219,7 +3217,6 @@ static void
 xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view)
 {
     GList *l = NULL;
-    guint total_cells = (guint)icon_view->priv->nrows * icon_view->priv->ncols;
     
     /* move all icons into the pending_icons list and remove from the desktop */
     for(l = icon_view->priv->icons; l; l = l->next) {
@@ -3237,7 +3234,8 @@ xfdesktop_move_all_icons_to_pending_icons_list(XfdesktopIconView *icon_view)
     icon_view->priv->icons = NULL;
 
     memset(icon_view->priv->grid_layout, 0,
-           total_cells * sizeof(XfdesktopIcon *));
+           (guint)icon_view->priv->nrows * icon_view->priv->ncols
+           * sizeof(XfdesktopIcon *));
     
     xfdesktop_setup_grids(icon_view);
 }
@@ -3373,8 +3371,6 @@ xfdesktop_move_all_pending_icons_to_desktop(XfdesktopIconView *icon_view)
 static void
 xfdesktop_grid_do_resize(XfdesktopIconView *icon_view)
 {
-    guint total_cells = (guint)icon_view->priv->nrows * icon_view->priv->ncols;
-
     xfdesktop_move_all_icons_to_pending_icons_list(icon_view);
 
 #if 0 /*def DEBUG*/
@@ -3382,7 +3378,8 @@ xfdesktop_grid_do_resize(XfdesktopIconView *icon_view)
 #endif
 
     memset(icon_view->priv->grid_layout, 0,
-           total_cells * sizeof(XfdesktopIcon *));
+           (guint)icon_view->priv->nrows * icon_view->priv->ncols
+           * sizeof(XfdesktopIcon *));
     
     xfdesktop_setup_grids(icon_view);
 


More information about the Xfce4-commits mailing list