diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 81bb82063..eff12edfe 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,10 @@ +1999-11-29 Federico Mena Quintero + + * gdesktop.c (desktop_arrange_icons): Return immediately if there + are no icons in the desktop. BUGFIX: bugs.gnome.org #3789. + (desktop_popup): Desensitize the "arrange icons" commands if there + are no icons in the desktop. + 1999-11-01 Pavel Machek * make_thumb.c: close symlink hole diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index e58aa57ed..03d13da12 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -721,6 +721,11 @@ desktop_arrange_icons (SortType type) int xpos, ypos; panel = create_panel_from_desktop (); + if (panel->count == 0) { + free_panel_from_desktop (panel); + return; + } + sfn = sort_get_func_from_type (type); g_assert (sfn != NULL); @@ -2699,6 +2704,13 @@ desktop_popup (GdkEventButton *event) g_free (file2); panel = push_desktop_panel_hack (); + + /* Disable the "arrange icons" commands if there are no icons */ + + if (panel->count == 0) + for (i = 0; desktop_arrange_icons_items[i].type != GNOME_APP_UI_ENDOFINFO; i++) + gtk_widget_set_sensitive (desktop_arrange_icons_items[i].widget, FALSE); + gnome_popup_menu_do_popup_modal (popup, NULL, NULL, event, NULL); layout_panel_gone (panel); free_panel_from_desktop (panel);