summaryrefslogtreecommitdiff
path: root/libwnck
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2007-07-06 22:33:47 +0000
committerVincent Untz <vuntz@src.gnome.org>2007-07-06 22:33:47 +0000
commite5abf682f930be6d1112c2ff415a216cc8ccf331 (patch)
tree13407a928f5eb55b061c9d58c77c1231da471286 /libwnck
parentf650ea3bf6cab1662f09eaf73e93d76ead566bf1 (diff)
downloadlibwnck-e5abf682f930be6d1112c2ff415a216cc8ccf331.tar.gz
Keep a list of tasks that don't belong to any class group. Fix bug
2007-07-07 Vincent Untz <vuntz@gnome.org> Keep a list of tasks that don't belong to any class group. Fix bug #453777. And complete fix for bug #165075. * libwnck/tasklist.c: (wnck_tasklist_init): initialize new windows_without_class_group field. (wnck_tasklist_finalize): add new assertion (wnck_tasklist_size_allocate): append the tasks from windows_without_class_group to the list of visible tasks (wnck_tasklist_remove): remove the task from windows_without_class_group when it's needed (wnck_tasklist_free_tasks): add assertion (wnck_tasklist_update_lists): if there's no class group for the window, add it to windows_without_class_group svn path=/trunk/; revision=1394
Diffstat (limited to 'libwnck')
-rw-r--r--libwnck/tasklist.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 1f75a82..e418d52 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -186,6 +186,7 @@ struct _WnckTasklistPrivate
/* Calculated by update_lists */
GList *class_groups;
GList *windows;
+ GList *windows_without_class_group;
/* Not handled by update_lists */
GList *startup_sequences;
@@ -669,6 +670,7 @@ wnck_tasklist_init (WnckTasklist *tasklist)
tasklist->priv->class_groups = NULL;
tasklist->priv->windows = NULL;
+ tasklist->priv->windows_without_class_group = NULL;
tasklist->priv->startup_sequences = NULL;
@@ -851,6 +853,7 @@ wnck_tasklist_finalize (GObject *object)
*/
g_assert (tasklist->priv->class_groups == NULL);
g_assert (tasklist->priv->windows == NULL);
+ g_assert (tasklist->priv->windows_without_class_group == NULL);
g_assert (tasklist->priv->startup_sequences == NULL);
/* wnck_tasklist_free_tasks (tasklist); */
@@ -1568,6 +1571,19 @@ wnck_tasklist_size_allocate (GtkWidget *widget,
l = l->next;
}
+ /* Add all windows that are ungrouped because they don't belong to any class
+ * group */
+ l = tasklist->priv->windows_without_class_group;
+ while (l != NULL)
+ {
+ WnckTask *task;
+
+ task = WNCK_TASK (l->data);
+ visible_tasks = g_list_append (visible_tasks, task);
+
+ l = l->next;
+ }
+
/* Add all startup sequences */
visible_tasks = g_list_concat (visible_tasks, g_list_copy (tasklist->priv->startup_sequences));
@@ -1776,6 +1792,23 @@ wnck_tasklist_remove (GtkContainer *container,
tasklist = WNCK_TASKLIST (container);
+ /* it's safer to handle windows_without_class_group before windows */
+ tmp = tasklist->priv->windows_without_class_group;
+ while (tmp != NULL)
+ {
+ WnckTask *task = WNCK_TASK (tmp->data);
+ tmp = tmp->next;
+
+ if (task->button == widget)
+ {
+ tasklist->priv->windows_without_class_group =
+ g_list_remove (tasklist->priv->windows_without_class_group,
+ task);
+ g_object_unref (task);
+ break;
+ }
+ }
+
tmp = tasklist->priv->windows;
while (tmp != NULL)
{
@@ -2095,6 +2128,7 @@ wnck_tasklist_free_tasks (WnckTasklist *tasklist)
}
}
g_assert (tasklist->priv->windows == NULL);
+ g_assert (tasklist->priv->windows_without_class_group == NULL);
g_assert (g_hash_table_size (tasklist->priv->win_hash) == 0);
if (tasklist->priv->class_groups)
@@ -2276,6 +2310,13 @@ wnck_tasklist_update_lists (WnckTasklist *tasklist)
g_list_prepend (class_group_task->windows,
win_task);
}
+ else
+ {
+ g_object_ref (win_task);
+ tasklist->priv->windows_without_class_group =
+ g_list_prepend (tasklist->priv->windows_without_class_group,
+ win_task);
+ }
}
else if (tasklist_include_in_skipped_list (tasklist, win))
{