diff options
author | Havoc Pennington <hp@redhat.com> | 2003-12-13 03:59:23 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2003-12-13 03:59:23 +0000 |
commit | 39ed3c0f7a2950b3f301e6bbd4b448202efef06b (patch) | |
tree | ce3fa342eb49f575e37049285f04b367a44337c1 | |
parent | 8dc8f120f9f44794cea9fa68423dfcb2fa9f5a80 (diff) | |
download | metacity-39ed3c0f7a2950b3f301e6bbd4b448202efef06b.tar.gz |
unstick window to get it out of mru_list it should not be in; assert that
2003-12-12 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_free): unstick window to get it out of
mru_list it should not be in; assert that window has been removed
from all mru_list. Perhaps fixes #122016 crash.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/window.c | 23 | ||||
-rw-r--r-- | src/workspace.c | 1 |
3 files changed, 28 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2003-12-12 Havoc Pennington <hp@redhat.com> + + * src/window.c (meta_window_free): unstick window to get it out of + mru_list it should not be in; assert that window has been removed + from all mru_list. Perhaps fixes #122016 crash. + 2003-11-15 Rob Adams <readams@readams.net> * src/window.c (update_net_wm_type): don't set window->type_atom diff --git a/src/window.c b/src/window.c index 94f2928e..11cebbd7 100644 --- a/src/window.c +++ b/src/window.c @@ -921,6 +921,12 @@ meta_window_free (MetaWindow *window) meta_window_unqueue_move_resize (window); meta_window_unqueue_update_icon (window); meta_window_free_delete_dialog (window); + + /* We need to unstick to remove the window from + * any workspace->mru_list for workspaces not + * in window->workspaces + */ + meta_window_unstick (window); tmp = window->workspaces; while (tmp != NULL) @@ -937,6 +943,19 @@ meta_window_free (MetaWindow *window) g_assert (window->workspaces == NULL); +#ifndef G_DISABLE_CHECKS + tmp = window->screen->workspaces; + while (tmp != NULL) + { + MetaWorkspace *workspace = tmp->data; + + g_assert (g_list_find (workspace->windows, window) == NULL); + g_assert (g_list_find (workspace->mru_list, window) == NULL); + + tmp = tmp->next; + } +#endif + meta_stack_remove (window->screen->stack, window); /* FIXME restore original size if window has maximized */ @@ -3211,7 +3230,7 @@ meta_window_stick (MetaWindow *window) { workspace = (MetaWorkspace *) tmp->data; if (!g_list_find (workspace->mru_list, window)) - workspace->mru_list = g_list_append (workspace->mru_list, window); + workspace->mru_list = g_list_append (workspace->mru_list, window); tmp = tmp->next; } @@ -3240,7 +3259,7 @@ meta_window_unstick (MetaWindow *window) { workspace = (MetaWorkspace *) tmp->data; if (!meta_workspace_contains_window (workspace, window)) - workspace->mru_list = g_list_remove (workspace->mru_list, window); + workspace->mru_list = g_list_remove (workspace->mru_list, window); tmp = tmp->next; } diff --git a/src/workspace.c b/src/workspace.c index c16c2c11..e8a820df 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -85,6 +85,7 @@ meta_workspace_free (MetaWorkspace *workspace) } g_assert (workspace->windows == NULL); + g_assert (workspace->mru_list == NULL); screen = workspace->screen; |