Index: awn-x.h =================================================================== --- awn-x.h (revision 227) +++ awn-x.h (working copy) @@ -43,5 +43,6 @@ GdkPixbuf * awn_x_get_icon_for_window (WnckWindow *window, gint width, gint height); GdkPixbuf * awn_x_get_icon_for_launcher (GnomeDesktopItem *item, gint width, gint height); +GString * awn_x_get_application_name (WnckWindow *window, WnckApplication *app); #endif Index: awn-task.c =================================================================== --- awn-task.c (revision 227) +++ awn-task.c (working copy) @@ -2016,10 +2016,14 @@ } else { WnckApplication *app = NULL; app = wnck_window_get_application (priv->window); - if (app == NULL) + if (app == NULL) { name = NULL; - else - name = g_strdup (wnck_application_get_name (app)); + } + else { + //name = g_strdup (wnck_application_get_name (app)); + GString *gname = awn_x_get_application_name(priv->window, app); + name = g_strdup(gname->str); + } } if (name == NULL) { /* Somethings gone very wrong */ @@ -2028,7 +2032,7 @@ gtk_widget_destroy (dialog); return; } - + /* Replace spaces with dashs */ int i = 0; for (i = 0; i < strlen (name); i++) { Index: awn-x.c =================================================================== --- awn-x.c (revision 227) +++ awn-x.c (working copy) @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -118,6 +119,37 @@ _wnck_error_trap_pop (); } +GString * +awn_x_get_application_name (WnckWindow *window, WnckApplication *app) +{ + GString *windowName = NULL; + GString *name = NULL; + // + //special case so that we can have different icons for the + //different OpenOffice applications + windowName = g_string_new(wnck_window_get_name(window)); + if (strstr((const char *)windowName->str, "- OpenOffice.org ")) { + if (strstr((const char *)windowName->str, "- OpenOffice.org Writer")) { + name = g_string_new("OpenOffice_Writer"); + } + else if (strstr((const char *)windowName->str, "- OpenOffice.org Calc")) { + name = g_string_new("OpenOffice_Calc"); + } + else if (strstr((const char *)windowName->str, "- OpenOffice.org Impress")) { + name = g_string_new("OpenOffice_Impress"); + } + else if (strstr((const char *)windowName->str, "- OpenOffice.org Base")) { + name = g_string_new("OpenOffice_Base"); + } + } + else { + //usual case + name = g_string_new(wnck_application_get_name(app)); + } + + return name; +} + GdkPixbuf * awn_x_get_icon_for_window (WnckWindow *window, gint width, gint height) { @@ -132,14 +164,16 @@ app = wnck_window_get_application (window); g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL); - name = g_string_new (wnck_application_get_name (app)); + name = awn_x_get_application_name(window, app); + name = g_string_prepend (name, ".awn/custom-icons/"); + int i = 0; for (i = 0; i < name->len; i++) { if (name->str[i] == ' ') name->str[i] = '-'; } - + uri = gnome_util_prepend_user_home(name->str); icon = gdk_pixbuf_new_from_file_at_scale (uri, width, height, TRUE, NULL);