Added failback image handling in dirmenu plugin.
authorJim Huang <jserv.tw@gmail.com>
Sun, 12 Nov 2006 19:23:50 +0000 (19:23 +0000)
committerJim Huang <jserv.tw@gmail.com>
Sun, 12 Nov 2006 19:23:50 +0000 (19:23 +0000)
src/plugins/dirmenu.c

index 483ce30..13a852a 100644 (file)
@@ -111,7 +111,7 @@ static void on_deselect( GtkMenuItem* item, GtkMenu* parent )
     gtk_menu_item_set_submenu( item, gtk_menu_new() );
 }
 
-GtkWidget* create_menu( const char* path, gboolean open_at_top )
+static GtkWidget* create_menu( const char* path, gboolean open_at_top )
 {
     GDir* dir;
     GtkWidget *menu = gtk_menu_new();
@@ -273,6 +273,12 @@ dirmenu_constructor(plugin *p, char **fp)
         h = 10000;
     }
 
+    /* FIXME: Failback image shouldn't be hardcoded.
+              This must be fixed before next release.
+     */
+    if (! fname)
+           fname = strdup("gnome-system");
+
     dm->button = fb_button_new_from_file(fname, w, h, 0x202020, TRUE);
     gtk_container_set_border_width( GTK_CONTAINER(dm->button), 0 );
     g_signal_connect( dm->button, "button_press_event",