Commit e5abf682 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz

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
parent f650ea3b
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
2007-06-29 Vincent Untz <vuntz@gnome.org>
* libwnck/application.c: (update_name): add assertion to make it clear
......
......@@ -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))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment