From 67c36f09176d1282d6a197a163ce9fcd8eb59eb7 Mon Sep 17 00:00:00 2001 From: Rob Adams Date: Sun, 16 Nov 2003 21:50:51 +0000 Subject: [PATCH] add paranoia check to make sure a window is really on a workspace before 2003-11-16 Rob Adams * src/window.c (meta_window_notify_focus): add paranoia check to make sure a window is really on a workspace before inserting it at the beginning of the MRU list. Maybe there's a race condition with focusing and workspace switching. Hopefully a fix for #122016. --- ChangeLog | 8 ++++++++ src/window.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f39d5d491..18098d85d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-16 Rob Adams + + * src/window.c (meta_window_notify_focus): add paranoia check to + make sure a window is really on a workspace before inserting it at + the beginning of the MRU list. Maybe there's a race condition + with focusing and workspace switching. Hopefully a fix for + #122016. + 2003-11-15 Havoc Pennington * src/main.c (main): fix warning diff --git a/src/window.c b/src/window.c index e47fcfce0..ebf533eb4 100644 --- a/src/window.c +++ b/src/window.c @@ -4046,10 +4046,10 @@ meta_window_notify_focus (MetaWindow *window, window->has_focus = TRUE; /* Move to the front of the focusing workspace's MRU list - * FIXME: is the active workspace guaranteed to be the focusing - * workspace? */ - if (window->screen->active_workspace) + if (window->screen->active_workspace && + g_list_find (window->screen->active_workspace->mru_list, + window)) { window->screen->active_workspace->mru_list = g_list_remove (window->screen->active_workspace->mru_list,