From 66fd1410da40f93a37c8d1f4657a012ee1e159b8 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Sat, 16 Dec 2006 01:13:55 +0000 Subject: [PATCH] Bug #362241 --> thread pane selection is lost when thunderbird compacts folders in the background. sr=bienvenu git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@217037 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mail/base/content/msgMail3PaneWindow.js | 8 ++++++++ mozilla/mail/base/content/widgetglue.js | 2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/mail/base/content/msgMail3PaneWindow.js b/mozilla/mail/base/content/msgMail3PaneWindow.js index 4e1f18899a4..4c12f74d833 100644 --- a/mozilla/mail/base/content/msgMail3PaneWindow.js +++ b/mozilla/mail/base/content/msgMail3PaneWindow.js @@ -550,6 +550,14 @@ function HandleCompactCompleted(folder) viewType = dbFolderInfo.viewType; dbFolderInfo = null; } + + // before we reroot the folder, save off the currently displayed message + // so we can restore selection after re-rooting. For the manual compaction case, + // we've already saved this value off before we cleared the view and the thread pane. + // For the automatic folder compaction case, gDBView is still valid and we haven't + // saved off gCurrentlyDisplayedMessage yet. + if (gCurrentlyDisplayedMessage == nsMsgViewIndex_None && gDBView) + gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage; RerootFolder(uri, msgFolder, viewType, viewFlags, sortType, sortOrder); LoadCurrentlyDisplayedMessage(); } diff --git a/mozilla/mail/base/content/widgetglue.js b/mozilla/mail/base/content/widgetglue.js index f72e95407bb..dd9bb05bb7f 100644 --- a/mozilla/mail/base/content/widgetglue.js +++ b/mozilla/mail/base/content/widgetglue.js @@ -167,9 +167,7 @@ function MsgCompactFolder(isAll) if (expungedBytes > 0) { if (gDBView) - { gCurrentlyDisplayedMessage = gDBView.currentlyDisplayedMessage; - } ClearThreadPaneSelection(); ClearThreadPane();