diff options
author | Havoc Pennington <hp@pobox.com> | 2002-03-24 14:27:01 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2002-03-24 14:27:01 +0000 |
commit | b99dafb1aa45c1740afb6bb813e542ebf9f1136c (patch) | |
tree | d426f80fc3b553e8a749262b387c7ccb6b5b3e76 /libwnck | |
parent | f17d1c5ca4a13a8ee0a3fa662797a600ce192528 (diff) | |
download | libwnck-b99dafb1aa45c1740afb6bb813e542ebf9f1136c.tar.gz |
include number of windows in the text for an application, #75943
2002-03-24 Havoc Pennington <hp@pobox.com>
* libwnck/tasklist.c (wnck_task_get_text): include number of
windows in the text for an application, #75943
Diffstat (limited to 'libwnck')
-rw-r--r-- | libwnck/application.c | 8 | ||||
-rw-r--r-- | libwnck/application.h | 3 | ||||
-rw-r--r-- | libwnck/tasklist.c | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/libwnck/application.c b/libwnck/application.c index 20ac68a..b510179 100644 --- a/libwnck/application.c +++ b/libwnck/application.c @@ -199,6 +199,14 @@ wnck_application_get_windows (WnckApplication *app) return app->priv->windows; } +int +wnck_application_get_n_windows (WnckApplication *app) +{ + g_return_val_if_fail (WNCK_IS_APPLICATION (app), 0); + + return g_list_length (app->priv->windows); +} + /** * wnck_application_get_name: * @app: a #WnckApplication diff --git a/libwnck/application.h b/libwnck/application.h index 1ab1888..a4f500d 100644 --- a/libwnck/application.h +++ b/libwnck/application.h @@ -62,7 +62,8 @@ WnckApplication* wnck_application_get (gulong xwindow); gulong wnck_application_get_xid (WnckApplication *app); -GList* wnck_application_get_windows (WnckApplication *app); +GList* wnck_application_get_windows (WnckApplication *app); +int wnck_application_get_n_windows (WnckApplication *app); /* application_get_name, application_get_pid, etc.; prefer to read * properties straight off the group leader, and failing that, if the diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c index 0b79eb5..2be39fc 100644 --- a/libwnck/tasklist.c +++ b/libwnck/tasklist.c @@ -1293,7 +1293,9 @@ wnck_task_get_text (WnckTask *task) if (task->is_application) { - return g_strdup (wnck_application_get_name (task->application)); + return g_strdup_printf ("%s (%d)", + wnck_application_get_name (task->application), + wnck_application_get_n_windows (task->application)); } else { |