summaryrefslogtreecommitdiff
path: root/libwnck
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-03-24 14:27:01 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-03-24 14:27:01 +0000
commitb99dafb1aa45c1740afb6bb813e542ebf9f1136c (patch)
treed426f80fc3b553e8a749262b387c7ccb6b5b3e76 /libwnck
parentf17d1c5ca4a13a8ee0a3fa662797a600ce192528 (diff)
downloadlibwnck-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.c8
-rw-r--r--libwnck/application.h3
-rw-r--r--libwnck/tasklist.c4
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
{