Bug 132489. Caret should stop blinking when user enters menus. r=kyle, sr=bryner.

This commit is contained in:
aaronl%netscape.com 2003-01-03 01:14:00 +00:00
Родитель de12811c7c
Коммит d80c02ce93
1 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -234,17 +234,18 @@ nsMenuBarFrame::SetActive(PRBool aActiveFlag)
break;
document->GetShellAt(0, getter_AddRefs(presShell));
if (!presShell)
break;
nsCOMPtr<nsICaret> caret;
presShell->GetCaret(getter_AddRefs(caret));
if (!caret)
break;
nsCOMPtr<nsISelectionController> selCon(do_QueryInterface(presShell));
NS_ASSERTION(selCon, "No selection controller for presShell");
if (mIsActive) // store whether caret was visible so that we can restore that state when menu is closed
caret->GetCaretVisible(&mCaretWasVisible);
if (mCaretWasVisible)
caret->SetCaretVisible(!mIsActive);
if (mIsActive) {// store whether caret was visible so that we can restore that state when menu is closed
PRBool isCaretVisible;
selCon->GetCaretEnabled(&isCaretVisible);
mCaretWasVisible |= isCaretVisible;
}
selCon->SetCaretEnabled(!mIsActive && mCaretWasVisible);
if (!mIsActive) {
mCaretWasVisible = PR_FALSE;
}
} while (0);
NS_NAMED_LITERAL_STRING(active, "DOMMenuBarActive");