[Xfce4-commits] <xfdesktop:master> Fix a crash when minimized window icons are resized (Bug #8963)

Eric Koegel noreply at xfce.org
Sat Dec 22 08:00:01 CET 2012


Updating branch refs/heads/master
         to f7adb946ba9c3d8dead0935386bc34c74903c59b (commit)
       from a466535e7b672612fd8743fc681cbccc04fa7c90 (commit)

commit f7adb946ba9c3d8dead0935386bc34c74903c59b
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sat Dec 22 09:56:17 2012 +0300

    Fix a crash when minimized window icons are resized (Bug #8963)

 src/xfdesktop-icon-view.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/xfdesktop-icon-view.c b/src/xfdesktop-icon-view.c
index ef5e869..1ea1296 100644
--- a/src/xfdesktop-icon-view.c
+++ b/src/xfdesktop-icon-view.c
@@ -3040,10 +3040,10 @@ xfdesktop_icon_view_paint_icon(XfdesktopIconView *icon_view,
 static void
 xfdesktop_grid_do_resize(XfdesktopIconView *icon_view)
 {
-    XfdesktopFileIconManager *fmanager;
+    XfdesktopFileIconManager *fmanager = NULL;
     GList *l, *leftovers = NULL;
     
-    //* move all icons into the pending_icons list and remove from the desktop */
+    /* move all icons into the pending_icons list and remove from the desktop */
     for(l = icon_view->priv->icons; l; l = l->next) {
         guint16 old_row, old_col;
 
@@ -3068,8 +3068,9 @@ xfdesktop_grid_do_resize(XfdesktopIconView *icon_view)
     
     DUMP_GRID_LAYOUT(icon_view);
 
-#ifdef ENABLE_FILE_ICONS    
-    fmanager = XFDESKTOP_FILE_ICON_MANAGER(icon_view->priv->manager);
+#ifdef ENABLE_FILE_ICONS
+    if(XFDESKTOP_IS_FILE_ICON_MANAGER(icon_view->priv->manager))
+        fmanager = XFDESKTOP_FILE_ICON_MANAGER(icon_view->priv->manager);
 #endif
 
     /* add all icons back */
@@ -3079,7 +3080,8 @@ xfdesktop_grid_do_resize(XfdesktopIconView *icon_view)
 
 #ifdef ENABLE_FILE_ICONS
         /* Try to get the cached position for the new resolution */
-        if(xfdesktop_file_icon_manager_get_cached_icon_position(
+        if(fmanager != NULL &&
+           xfdesktop_file_icon_manager_get_cached_icon_position(
                                                             fmanager,
                                                             xfdesktop_icon_peek_label(icon),
                                                             &row,


More information about the Xfce4-commits mailing list